Class AudioDevice
Definition
- Namespace:
- Tizen.Multimedia
- Assembly:
- Tizen.Multimedia.dll
Provides the ability to query the information of sound devices.
C#Copypublic class AudioDevice
- Inheritance
-
objectAudioDevice
Properties
Declaration
C#Copypublic int Id { get; }
Property Value
| Type | Description |
|---|---|
| int | The id of the device. |
Declaration
C#Copypublic AudioDeviceIoDirection IoDirection { get; }
Property Value
| Type | Description |
|---|---|
| AudioDeviceIoDirection | The IO direction of the device. |
Declaration
C#Copypublic bool IsRunning { get; }
Property Value
| Type | Description |
|---|---|
| bool | true if the audio stream of device is running actually; otherwise, false. |
Declaration
C#Copypublic string Name { get; }
Property Value
| Type | Description |
|---|---|
| string | The name of the device. |
Declaration
C#Copypublic AudioDeviceType Type { get; }
Property Value
| Type | Description |
|---|---|
| AudioDeviceType | The AudioDeviceType of the device. |
Methods
Declaration
C#Copypublic 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
Declaration
C#Copypublic 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. |
Declaration
C#Copypublic override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | The hash code for this instance of AudioDevice. |
Overrides
Declaration
C#Copypublic 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. |
Declaration
C#Copypublic 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. |
Declaration
C#Copypublic 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. |
Declaration
C#Copypublic 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. |
Declaration
C#Copypublic 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. |
Declaration
C#Copypublic 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. |
Declaration
C#Copypublic 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. |
Declaration
C#Copypublic 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. |
Declaration
C#Copypublic 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. |
Declaration
C#Copypublic override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |