Class AudioDevice
Definition
- Namespace:
- Tizen.Multimedia
- Assembly:
- Tizen.Multimedia.dll
Provides the ability to query the information of sound devices.
public class AudioDevice
- Inheritance
-
objectAudioDevice
Properties
View SourceId
Gets the ID of the device.
Declaration
public int Id { get; }
Property Value
Type | Description |
---|---|
int | The id of the device. |
IoDirection
Gets the IO direction of the device.
Declaration
public AudioDeviceIoDirection IoDirection { get; }
Property Value
Type | Description |
---|---|
AudioDeviceIoDirection | The IO direction of the device. |
IsRunning
Gets the running state of the device.
Declaration
public bool IsRunning { get; }
Property Value
Type | Description |
---|---|
bool | true if the audio stream of device is running actually; otherwise, false. |
Name
Gets the name of the device.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string | The name of the device. |
State
Gets the state of the device.
Declaration
[Obsolete("Deprecated since API level 5. Please use the IsRunning property instead.")]
public AudioDeviceState State { get; }
Property Value
Type | Description |
---|---|
AudioDeviceState | The AudioDeviceState of the device. |
Type
Gets the type of the device.
Declaration
public AudioDeviceType Type { get; }
Property Value
Type | Description |
---|---|
AudioDeviceType | The AudioDeviceType of the device. |
Methods
View SourceEquals(object)
Compares an object to an instance of AudioDevice for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | A object to compare. |
Returns
Type | Description |
---|---|
bool | true if the two devices are equal; otherwise, false. |
Overrides
GetAvoidResampling()
Gets the device's 'avoid resampling' property.
Declaration
public bool GetAvoidResampling()
Returns
Type | Description |
---|---|
bool | The 'avoid resampling' property of the device. |
Remarks
This device should be UsbAudio type and Output direction. This property is not enabled as default. With this enabled, this device will use the first stream's original sample format and rate without resampling if supported.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This device is not valid or is disconnected. |
GetHashCode()
Gets the hash code for this instance of AudioDevice.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | The hash code for this instance of AudioDevice. |
Overrides
GetMediaStreamOnly()
Gets the restriction of stream type only for media.
Declaration
public bool GetMediaStreamOnly()
Returns
Type | Description |
---|---|
bool | The 'media stream only' property of the device. |
Remarks
This device should be UsbAudio type and Output direction. This property is not enabled as default. With this enabled, no other stream types except Media are not allowed to this device.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This device is not valid or is disconnected. |
GetSampleFormat()
Gets the device's sample format.
Declaration
public AudioSampleFormat GetSampleFormat()
Returns
Type | Description |
---|---|
AudioSampleFormat | The AudioSampleFormat of the device. |
Remarks
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This device is not valid or is disconnected. |
GetSampleRate()
Gets the device's sample rate.
Declaration
public uint GetSampleRate()
Returns
Type | Description |
---|---|
uint | The sample rate of the device. |
Remarks
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This device is not valid or is disconnected. |
GetSupportedSampleFormats()
Gets the device's supported sample formats.
Declaration
public IEnumerable<AudioSampleFormat> GetSupportedSampleFormats()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><AudioSampleFormat> | An IEnumerable<AudioSampleFormat> that contains supported sample formats. |
Remarks
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This device is not valid or is disconnected. |
GetSupportedSampleRates()
Gets the device's supported sample rates.
Declaration
public IEnumerable<uint> GetSupportedSampleRates()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><uint> | An IEnumerable<uint> that contains supported sample rates. |
Remarks
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This device is not valid or is disconnected. |
SetAvoidResampling(bool)
Sets the device's 'avoid resampling' property.
Declaration
public void SetAvoidResampling(bool enable)
Parameters
Type | Name | Description |
---|---|---|
bool | enable | The 'avoid resampling' value to set to the device. |
Remarks
This device should be UsbAudio type and Output direction. This property is not enabled as default. With this enabled, this device will use the first stream's original sample format and rate without resampling if supported.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This device is not valid or is disconnected. |
SetMediaStreamOnly(bool)
Sets the restriction of stream type only for media.
Declaration
public void SetMediaStreamOnly(bool enable)
Parameters
Type | Name | Description |
---|---|---|
bool | enable | The 'media stream only' value to set to the device. |
Remarks
This device should be UsbAudio type and Output direction. This property is not enabled as default. With this enabled, no other stream types except Media are not allowed to this device.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This device is not valid or is disconnected. |
SetSampleFormat(AudioSampleFormat)
Sets the device's sample format.
Declaration
public void SetSampleFormat(AudioSampleFormat format)
Parameters
Type | Name | Description |
---|---|---|
AudioSampleFormat | format | The AudioSampleFormat to set to the device. |
Remarks
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This device is not valid or is disconnected. |
SetSampleRate(uint)
Sets the device's sample rate.
Declaration
public void SetSampleRate(uint rate)
Parameters
Type | Name | Description |
---|---|---|
uint | rate | The sample rate to set to the device. |
Remarks
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | This device is not valid or is disconnected. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |