Class AudioPlayback

    Definition

    Namespace:
    Tizen.Multimedia
    Assembly:
    Tizen.Multimedia.AudioIO.dll

    Provides the ability to directly manage the system audio output devices and play the PCM (pulse-code modulation) data.

    public class AudioPlayback : IDisposable
    Inheritance
    object
    AudioPlayback

    Constructors

    View Source

    AudioPlayback(int, AudioChannel, AudioSampleType)

    Initializes a new instance of the AudioPlayback class with the specified sample rate, channel, and sample type.

    Declaration
    public AudioPlayback(int sampleRate, AudioChannel channel, AudioSampleType sampleType)
    Parameters
    Type Name Description
    int sampleRate

    The audio sample rate (8000 ~ 192000Hz).

    AudioChannel channel

    The audio channel type.

    AudioSampleType sampleType

    The audio sample type.

    Fields

    View Source

    MaxSampleRate

    Specifies the maximum value allowed for the audio capture, in Hertz (Hz).

    Declaration
    public static readonly int MaxSampleRate
    Field Value
    Type Description
    int
    See Also
    SampleRate
    View Source

    MinSampleRate

    Specifies the minimum value allowed for the audio capture, in Hertz (Hz).

    Declaration
    public static readonly int MinSampleRate
    Field Value
    Type Description
    int
    See Also
    SampleRate

    Properties

    View Source

    Channel

    Gets the channel type of the audio output data stream.

    Declaration
    public AudioChannel Channel { get; }
    Property Value
    Type Description
    AudioChannel
    View Source

    SampleRate

    Gets the sample rate of the audio output data stream, in Hertz (Hz).

    Declaration
    public int SampleRate { get; }
    Property Value
    Type Description
    int
    View Source

    SampleType

    Gets the sample type of the audio output data stream.

    Declaration
    public AudioSampleType SampleType { get; }
    Property Value
    Type Description
    AudioSampleType
    View Source

    StreamType

    Gets the sound type supported by the audio output device.

    Declaration
    public AudioStreamType StreamType { get; }
    Property Value
    Type Description
    AudioStreamType

    Methods

    View Source

    ApplyStreamPolicy(AudioStreamPolicy)

    Applies the sound stream information to the AudioPlayback.

    Declaration
    public void ApplyStreamPolicy(AudioStreamPolicy streamPolicy)
    Parameters
    Type Name Description
    AudioStreamPolicy streamPolicy

    The AudioStreamPolicy to apply for the AudioPlayback.

    View Source

    Dispose()

    Releases all resources used by the AudioPlayback object.

    Declaration
    public void Dispose()
    View Source

    Dispose(bool)

    Releases the resources used by the AudioPlayback object.

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

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    View Source

    Drain()

    Drains the buffered audio data from the output stream. It blocks the calling thread until the drain of the stream buffer is complete, for example, at the end of playback.

    Declaration
    public void Drain()
    View Source

    ~AudioPlayback()

    Finalizes an instance of the AudioPlayback class.

    Declaration
    protected ~AudioPlayback()
    View Source

    Flush()

    Flushes and discards the buffered audio data from the output stream.

    Declaration
    public void Flush()
    View Source

    GetBufferSize()

    Gets the size allocated for the audio output buffer.

    Declaration
    public int GetBufferSize()
    Returns
    Type Description
    int
    View Source

    Pause()

    Pauses feeding of the audio data to the device.

    Declaration
    public void Pause()
    Remarks

    It has no effect if the current state is Paused.

    See Also
    Resume()
    View Source

    Prepare()

    Prepares the AudioPlayback.

    Declaration
    public void Prepare()
    Remarks

    This must be called before Write(byte[]).

    See Also
    Unprepare()
    View Source

    Resume()

    Resumes feeding of the audio data to the device.

    Declaration
    public void Resume()
    Remarks

    It has no effect if the current state is Running.

    See Also
    Pause()
    View Source

    Unprepare()

    Unprepares the AudioPlayback.

    Declaration
    public void Unprepare()
    See Also
    Prepare()
    View Source

    Write(byte[])

    Starts writing the audio data to the device.

    Declaration
    public int Write(byte[] buffer)
    Parameters
    Type Name Description
    byte[] buffer

    The buffer to write.

    Returns
    Type Description
    int

    The written size.

    Events

    View Source

    BufferAvailable

    Occurs when the audio playback data can be written.

    Declaration
    public event EventHandler<AudioPlaybackBufferAvailableEventArgs> BufferAvailable
    Event Type
    Type Description
    EventHandler<><AudioPlaybackBufferAvailableEventArgs>
    See Also
    Write(byte[])
    View Source

    StateChanged

    Occurs when the state of the AudioPlayback is changed.

    Declaration
    public event EventHandler<AudioIOStateChangedEventArgs> StateChanged
    Event Type
    Type Description
    EventHandler<><AudioIOStateChangedEventArgs>

    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