Class AudioPlayer

    Definition

    Namespace:
    Tizen.AIAvatar
    Assembly:
    Tizen.AIAvatar.dll

    Represents an audio player capable of streaming and playing audio with support for audio ducking.

    public class AudioPlayer : IDisposable
    Inheritance
    object
    AudioPlayer

    Constructors

    View Source

    AudioPlayer(AudioOptions)

    Initializes a new instance of the AudioPlayer class.

    Declaration
    public AudioPlayer(AudioOptions audioOptions = null)
    Parameters
    Type Name Description
    AudioOptions audioOptions

    Optional audio options for playback configuration.

    Properties

    View Source

    CurrentAudioPlayerState

    Gets or sets the current state of the audio player.

    Declaration
    public AudioPlayerState CurrentAudioPlayerState { get; protected set; }
    Property Value
    Type Description
    AudioPlayerState

    Methods

    View Source

    AddStream(byte[])

    Adds a new audio buffer to the stream list.

    Declaration
    public void AddStream(byte[] buffer)
    Parameters
    Type Name Description
    byte[] buffer

    The audio buffer to add.

    View Source

    Destroy()

    Destroys the audio player and clears all resources.

    Declaration
    public void Destroy()
    View Source

    Dispose()

    Releases all resources used by the AudioPlayer.

    Declaration
    public void Dispose()
    View Source

    Dispose(bool)

    Releases all resources used by the AudioPlayer.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    View Source

    IsPrepare()

    Determines if the audio player is prepared with a valid stream.

    Declaration
    public bool IsPrepare()
    Returns
    Type Description
    bool

    True if a valid stream is available; otherwise, false.

    View Source

    Pause()

    Pauses the current audio playback.

    Declaration
    public void Pause()
    View Source

    Play(byte[], int)

    Plays the provided audio buffer.

    Declaration
    public void Play(byte[] audioBytes, int sampleRate = 0)
    Parameters
    Type Name Description
    byte[] audioBytes

    The audio buffer to play.

    int sampleRate

    Optional sample rate for the audio playback.

    View Source

    PrepareStreamAudio(int)

    Prepare the audio from the stream asynchronously.

    Declaration
    public void PrepareStreamAudio(int sampleRate = 0)
    Parameters
    Type Name Description
    int sampleRate

    Optional sample rate for the audio playback.

    View Source

    Stop()

    Stops the current audio playback.

    Declaration
    public void Stop()

    Extension Methods

    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX