Class AudioPlayback
Definition
- Namespace:
- Tizen.Multimedia
- Assembly:
- Tizen.Multimedia.AudioIO.dll
- API Level:
- 3
Provides the ability to directly manage the system audio output devices and play the PCM (pulse-code modulation) data.
C#Copypublic class AudioPlayback : IDisposable
- Inheritance
-
System.ObjectAudioPlayback
- Implements
-
System.IDisposable
Constructors
AudioPlayback(Int32, AudioChannel, AudioSampleType)
Initializes a new instance of the AudioPlayback class with the specified sample rate, channel, and sample type.
Declaration
C#Copypublic AudioPlayback(int sampleRate, AudioChannel channel, AudioSampleType sampleType)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sampleRate | The audio sample rate (8000 ~ 192000Hz). |
AudioChannel | channel | The audio channel type. |
AudioSampleType | sampleType | The audio sample type. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException |
|
System.ArgumentException |
|
API Level: 3
Fields
Declaration
C#Copypublic static readonly int MaxSampleRate
Field Value
Type | Description |
---|---|
System.Int32 |
See Also
API Level: 3
Declaration
C#Copypublic static readonly int MinSampleRate
Field Value
Type | Description |
---|---|
System.Int32 |
See Also
API Level: 3
Properties
Declaration
C#Copypublic AudioChannel Channel { get; }
Property Value
Type | Description |
---|---|
AudioChannel |
API Level: 3
Declaration
C#Copypublic int SampleRate { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: 3
Declaration
C#Copypublic AudioSampleType SampleType { get; }
Property Value
Type | Description |
---|---|
AudioSampleType |
API Level: 3
Declaration
C#Copypublic AudioStreamType StreamType { get; }
Property Value
Type | Description |
---|---|
AudioStreamType |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The AudioPlayback has already been disposed of. |
API Level: 3
Methods
ApplyStreamPolicy(AudioStreamPolicy)
Applies the sound stream information to the AudioPlayback.
Declaration
C#Copypublic void ApplyStreamPolicy(AudioStreamPolicy streamPolicy)
Parameters
Type | Name | Description |
---|---|---|
AudioStreamPolicy | streamPolicy | The AudioStreamPolicy to apply for the AudioPlayback. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ObjectDisposedException |
|
System.NotSupportedException |
|
System.ArgumentException | Not able to retrieve information from |
API Level: 3
Declaration
C#Copypublic void Dispose()
API Level: 3
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
API Level: 3
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
C#Copypublic void Drain()
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The AudioPlayback has already been disposed of. |
System.InvalidOperationException | The current state is Idle. |
API Level: 3
Declaration
C#Copyprotected void Finalize()
Declaration
C#Copypublic void Flush()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The current state is Idle. |
ObjectDisposedException | The AudioPlayback has already been disposed of. |
API Level: 3
Declaration
C#Copypublic int GetBufferSize()
Returns
Type | Description |
---|---|
System.Int32 |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The AudioPlayback has already been disposed of. |
API Level: 3
Declaration
C#Copypublic void Pause()
Remarks
It has no effect if the current state is Paused.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The current state is Idle. |
ObjectDisposedException | The AudioPlayback has already been disposed of. |
See Also
API Level: 3
Declaration
C#Copypublic void Prepare()
Remarks
This must be called before Write(Byte[]).
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Operation failed due to an internal error. |
ObjectDisposedException | The AudioPlayback has already been disposed of. |
See Also
API Level: 3
Declaration
C#Copypublic void Resume()
Remarks
It has no effect if the current state is Running.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The current state is Idle. |
ObjectDisposedException | The AudioPlayback has already been disposed of. |
See Also
API Level: 3
Declaration
C#Copypublic void Unprepare()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Operation failed due to an internal error. |
ObjectDisposedException | The AudioPlayback has already been disposed of. |
See Also
API Level: 3
Declaration
C#Copypublic int Write(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | The buffer to write. |
Returns
Type | Description |
---|---|
System.Int32 | The written size. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
System.ArgumentException | The length of |
System.InvalidOperationException | The current state is not Running. |
ObjectDisposedException | The AudioPlayback has already been disposed of. |
API Level: 3
Events
Declaration
C#Copypublic event EventHandler<AudioPlaybackBufferAvailableEventArgs> BufferAvailable
Event Type
Type | Description |
---|---|
System.EventHandler<AudioPlaybackBufferAvailableEventArgs> |
See Also
API Level: 3
Declaration
C#Copypublic event EventHandler<AudioIOStateChangedEventArgs> StateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<AudioIOStateChangedEventArgs> |