Class AudioStreamPolicy
Definition
- Namespace:
- Tizen.Multimedia
- Assembly:
- Tizen.Multimedia.dll
Provides functionalities to control and manage sound streams within an application.
The Audio
public class AudioStreamPolicy : IDisposable
- Inheritance
-
objectAudio
Stream Policy
- Implements
-
System.
IDisposable
Constructors
View SourceAudioStreamPolicy(AudioStreamType)
Initializes a new instance of the Audio
Declaration
public AudioStreamPolicy(AudioStreamType streamType)
Parameters
Type | Name | Description |
---|---|---|
Audio |
streamType | The type of the sound stream for which the policy needs to be created. |
Remarks
To apply the stream policy according to this stream information, the AudioStreamPolicy should
be passed to other APIs related to playback or recording. (For example., Player,
Wav
Exceptions
Type | Condition |
---|---|
System. |
|
Properties
View SourceFocusReacquisitionEnabled
Gets or sets the auto focus reacquisition.
Declaration
public bool FocusReacquisitionEnabled { get; set; }
Property Value
Type | Description |
---|---|
bool | true if the auto focus reacquisition is enabled; otherwise, false. |
Remarks
If you don't want to reacquire the focus you've lost automatically, disable the focus reacquisition.
Exceptions
Type | Condition |
---|---|
System. |
The Audio |
PlaybackFocusState
Gets the state of focus for the playback.
Declaration
public AudioStreamFocusState PlaybackFocusState { get; }
Property Value
Type | Description |
---|---|
Audio |
The state of focus for playback. |
Exceptions
Type | Condition |
---|---|
System. |
The Audio |
PreferredInputDevice
Gets or sets the preferred input device.
Declaration
public AudioDevice PreferredInputDevice { get; set; }
Property Value
Type | Description |
---|---|
Audio |
The Audio |
Remarks
This property is to set a specific built-in device when the system has multiple devices of the same built-in device type. When there's only one device for a built-in device type in the system, nothing will happen even if this property is set successfully.
Exceptions
Type | Condition |
---|---|
System. |
A device is not for input. |
System. |
An internal error occurs. |
Audio |
A device is not supported by this Audio |
System. |
The Audio |
See Also
View SourcePreferredOutputDevice
Gets or sets the preferred output device.
Declaration
public AudioDevice PreferredOutputDevice { get; set; }
Property Value
Type | Description |
---|---|
Audio |
The Audio |
Remarks
This property is to set a specific built-in device when the system has multiple devices of the same built-in device type. When there's only one device for a built-in device type in the system, nothing will happen even if this property is set successfully.
Exceptions
Type | Condition |
---|---|
System. |
A device is not for output. |
System. |
An internal error occurs. |
Audio |
A device is not supported by this Audio |
System. |
The Audio |
See Also
View SourceRecordingFocusState
Gets the state of focus for the recording.
Declaration
public AudioStreamFocusState RecordingFocusState { get; }
Property Value
Type | Description |
---|---|
Audio |
The state of focus for recording. |
Exceptions
Type | Condition |
---|---|
System. |
The Audio |
VolumeType
Gets the Audio
Declaration
public AudioVolumeType VolumeType { get; }
Property Value
Type | Description |
---|---|
Audio |
The Audio |
Remarks
If the Audio
Exceptions
Type | Condition |
---|---|
System. |
The Audio |
Methods
View SourceAcquireFocus(AudioStreamFocusOptions, AudioStreamBehaviors, string)
Acquires the stream focus.
Declaration
public void AcquireFocus(AudioStreamFocusOptions options, AudioStreamBehaviors behaviors, string extraInfo)
Parameters
Type | Name | Description |
---|---|---|
Audio |
options | The focuses that you want to acquire. |
Audio |
behaviors | The requesting behaviors. |
string | extraInfo | The extra information for this request. This value can be null. |
Exceptions
Type | Condition |
---|---|
System. |
|
System. |
|
System. |
The focus has already been acquired. |
Audio |
Called in Focus |
System. |
The Audio |
AddDeviceForStreamRouting(AudioDevice)
Adds a device for the stream routing.
Declaration
public void AddDeviceForStreamRouting(AudioDevice device)
Parameters
Type | Name | Description |
---|---|---|
Audio |
device | The device to add. |
Remarks
The available Audio
Exceptions
Type | Condition |
---|---|
System. |
The device is not connected. |
System. |
|
Audio |
Audio |
System. |
The Audio |
See Also
View SourceApplyStreamRouting()
Applies the stream routing.
Declaration
public void ApplyStreamRouting()
Remarks
If the stream has not been made yet, this will be applied when the stream starts to play.
Exceptions
Type | Condition |
---|---|
System. |
A device has not been set. |
System. |
The Audio |
See Also
View SourceDispose()
Releases all resources used by the Audio
Declaration
public void Dispose()
Dispose(bool)
Releases the unmanaged resources used by the Audio
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. |
GetSoundEffect(bool)
Gets the sound effect.
Declaration
public SoundEffectInfo GetSoundEffect(bool withReference)
Parameters
Type | Name | Description |
---|---|---|
bool | withReference |
Returns
Type | Description |
---|---|
Sound |
Remarks
If withReference
is false, Reference
Exceptions
Type | Condition |
---|---|
System. |
The sound effect is not set yet.
|
System. |
Sound effect is not set yet. |
System. |
The Audio |
HasStreamOnDevice(AudioDevice)
Checks if any stream from the current AudioStreamPolicy is using the device.
Declaration
public bool HasStreamOnDevice(AudioDevice device)
Parameters
Type | Name | Description |
---|---|---|
Audio |
device | The device to be checked. |
Returns
Type | Description |
---|---|
bool | true if any audio stream from the current AudioStreamPolicy is using the device; otherwise, false. |
Remarks
The AudioStreamPolicy can be applied to each playback or recording stream via other API set.
(For example., Player, Wav
Exceptions
Type | Condition |
---|---|
System. |
|
System. |
An internal error occurs. |
System. |
The Audio |
See Also
View SourceReleaseFocus(AudioStreamFocusOptions, AudioStreamBehaviors, string)
Releases the acquired focus.
Declaration
public void ReleaseFocus(AudioStreamFocusOptions options, AudioStreamBehaviors behaviors, string extraInfo)
Parameters
Type | Name | Description |
---|---|---|
Audio |
options | The focus mask that you want to release. |
Audio |
behaviors | The requesting behaviors. |
string | extraInfo | The extra information for this request. This value can be null. |
Exceptions
Type | Condition |
---|---|
System. |
|
System. |
|
System. |
The focus has not been acquired. |
System. |
The Audio |
RemoveDeviceForStreamRouting(AudioDevice)
Removes the device for the stream routing.
Declaration
public void RemoveDeviceForStreamRouting(AudioDevice device)
Parameters
Type | Name | Description |
---|---|---|
Audio |
device | The device to remove. |
Remarks
The available Audio
Exceptions
Type | Condition |
---|---|
System. |
An internal error occurs. |
System. |
|
System. |
The Audio |
See Also
View SourceSetSoundEffect(SoundEffectInfo, bool)
Sets the sound effect.
Declaration
public void SetSoundEffect(SoundEffectInfo info, bool withReference)
Parameters
Type | Name | Description |
---|---|---|
Sound |
info | See Sound |
bool | withReference | A reference device for sound effect. |
Remarks
If withReference
is true, info.Type.Type
must be Referenceinfo.ReferenceDevice.ReferenceDevice
must not be null.
If withReference
is false, info.Type.Type
must be Noise
Exceptions
Type | Condition |
---|---|
System. |
When |
Audio |
The current Audio |
System. |
The Audio |
Events
View SourceFocusStateChanged
Occurs when the state of focus for the current Audio
Declaration
public event EventHandler<AudioStreamPolicyFocusStateChangedEventArgs> FocusStateChanged
Event Type
Type | Description |
---|---|
System. |
Remarks
The event is raised in the internal thread.
StreamFocusStateChanged
Occurs when the focus state for stream types is changed regardless of the process.
Declaration
public static event EventHandler<StreamFocusStateChangedEventArgs> StreamFocusStateChanged
Event Type
Type | Description |
---|---|
System. |