Class AudioDevice
Definition
- Namespace:
- Tizen.Multimedia
- Assembly:
- Tizen.Multimedia.dll
- API Level:
- 3
Provides the ability to query the information of sound devices.
public class AudioDevice
- Inheritance
-
AudioDevice
Properties
View SourceId
Gets the ID of the device.
Declaration
public int Id { get; }
Property Value
Type | Description |
---|---|
Int32 | The id of the device. |
API Level: 3
View SourceIoDirection
Gets the IO direction of the device.
Declaration
public AudioDeviceIoDirection IoDirection { get; }
Property Value
Type | Description |
---|---|
AudioDeviceIoDirection | The IO direction of the device. |
API Level: 3
View SourceIsRunning
Gets the running state of the device.
Declaration
public bool IsRunning { get; }
Property Value
Type | Description |
---|---|
Boolean | true if the audio stream of device is running actually; otherwise, false. |
API Level: 5
View SourceName
Gets the name of the device.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String | The name of the device. |
API Level: 3
View SourceType
Gets the type of the device.
Declaration
public AudioDeviceType Type { get; }
Property Value
Type | Description |
---|---|
AudioDeviceType | The AudioDeviceType of the device. |
API Level: 3
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 |
---|---|
Boolean | true if the two devices are equal; otherwise, false. |
Overrides
API Level: 4
View SourceGetAvoidResampling()
Gets the device's 'avoid resampling' property.
Declaration
public bool GetAvoidResampling()
Returns
Type | Description |
---|---|
Boolean | 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 |
---|---|
InvalidOperationException | This device is not valid or is disconnected. |
API Level: 5
View SourceGetHashCode()
Gets the hash code for this instance of AudioDevice.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | The hash code for this instance of AudioDevice. |
Overrides
API Level: 4
View SourceGetMediaStreamOnly()
Gets the restriction of stream type only for media.
Declaration
public bool GetMediaStreamOnly()
Returns
Type | Description |
---|---|
Boolean | 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 |
---|---|
InvalidOperationException | This device is not valid or is disconnected. |
API Level: 5
View SourceGetSampleFormat()
Gets the device's sample format.
Declaration
public AudioSampleFormat GetSampleFormat()
Returns
Type | Description |
---|---|
AudioSampleFormat | The AudioSampleFormat of the device. |
Remarks
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This device is not valid or is disconnected. |
API Level: 5
View SourceGetSampleRate()
Gets the device's sample rate.
Declaration
public uint GetSampleRate()
Returns
Type | Description |
---|---|
UInt32 | The sample rate of the device. |
Remarks
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This device is not valid or is disconnected. |
API Level: 5
View SourceGetSupportedSampleFormats()
Gets the device's supported sample formats.
Declaration
public IEnumerable<AudioSampleFormat> GetSupportedSampleFormats()
Returns
Type | Description |
---|---|
IEnumerable<AudioSampleFormat> | An IEnumerable<AudioSampleFormat> that contains supported sample formats. |
Remarks
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This device is not valid or is disconnected. |
API Level: 5
View SourceGetSupportedSampleRates()
Gets the device's supported sample rates.
Declaration
public IEnumerable<uint> GetSupportedSampleRates()
Returns
Type | Description |
---|---|
IEnumerable<UInt32> | An IEnumerable<uint> that contains supported sample rates. |
Remarks
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This device is not valid or is disconnected. |
API Level: 5
View SourceSetAvoidResampling(Boolean)
Sets the device's 'avoid resampling' property.
Declaration
public void SetAvoidResampling(bool enable)
Parameters
Type | Name | Description |
---|---|---|
Boolean | 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 |
---|---|
InvalidOperationException | This device is not valid or is disconnected. |
API Level: 5
View SourceSetMediaStreamOnly(Boolean)
Sets the restriction of stream type only for media.
Declaration
public void SetMediaStreamOnly(bool enable)
Parameters
Type | Name | Description |
---|---|---|
Boolean | 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 |
---|---|
InvalidOperationException | This device is not valid or is disconnected. |
API Level: 5
View SourceSetSampleFormat(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 |
---|---|
InvalidOperationException | This device is not valid or is disconnected. |
API Level: 5
View SourceSetSampleRate(UInt32)
Sets the device's sample rate.
Declaration
public void SetSampleRate(uint rate)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | rate | The sample rate to set to the device. |
Remarks
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This device is not valid or is disconnected. |
API Level: 5
View SourceToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string that represents the current object. |