Class AudioDevice

Definition

Namespace:
Tizen.Multimedia
Assembly:
Tizen.Multimedia.dll

Provides the ability to query the information of sound devices.

C#
Copy
public class AudioDevice
Inheritance
object
AudioDevice

Properties

View Source

Id

Gets the ID of the device.

Declaration
C#
Copy
public int Id { get; }
Property Value
Type Description
int

The id of the device.

View Source

IoDirection

Gets the IO direction of the device.

Declaration
C#
Copy
public AudioDeviceIoDirection IoDirection { get; }
Property Value
Type Description
AudioDeviceIoDirection

The IO direction of the device.

View Source

IsRunning

Gets the running state of the device.

Declaration
C#
Copy
public bool IsRunning { get; }
Property Value
Type Description
bool

true if the audio stream of device is running actually; otherwise, false.

View Source

Name

Gets the name of the device.

Declaration
C#
Copy
public string Name { get; }
Property Value
Type Description
string

The name of the device.

View Source

State

Gets the state of the device.

Declaration
C#
Copy
[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.

View Source

Type

Gets the type of the device.

Declaration
C#
Copy
public AudioDeviceType Type { get; }
Property Value
Type Description
AudioDeviceType

The AudioDeviceType of the device.

Methods

View Source

Equals(object)

Compares an object to an instance of AudioDevice for equality.

Declaration
C#
Copy
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
object.Equals(object)
View Source

GetAvoidResampling()

Gets the device's 'avoid resampling' property.

Declaration
C#
Copy
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.

View Source

GetHashCode()

Gets the hash code for this instance of AudioDevice.

Declaration
C#
Copy
public override int GetHashCode()
Returns
Type Description
int

The hash code for this instance of AudioDevice.

Overrides
object.GetHashCode()
View Source

GetMediaStreamOnly()

Gets the restriction of stream type only for media.

Declaration
C#
Copy
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.

View Source

GetSampleFormat()

Gets the device's sample format.

Declaration
C#
Copy
public AudioSampleFormat GetSampleFormat()
Returns
Type Description
AudioSampleFormat

The AudioSampleFormat of the device.

Remarks

This device should be UsbAudio type and Output direction.

Exceptions
Type Condition
System.InvalidOperationException

This device is not valid or is disconnected.

View Source

GetSampleRate()

Gets the device's sample rate.

Declaration
C#
Copy
public uint GetSampleRate()
Returns
Type Description
uint

The sample rate of the device.

Remarks

This device should be UsbAudio type and Output direction.

Exceptions
Type Condition
System.InvalidOperationException

This device is not valid or is disconnected.

View Source

GetSupportedSampleFormats()

Gets the device's supported sample formats.

Declaration
C#
Copy
public IEnumerable<AudioSampleFormat> GetSupportedSampleFormats()
Returns
Type Description
System.Collections.Generic.IEnumerable<T><AudioSampleFormat>

An IEnumerable<AudioSampleFormat> that contains supported sample formats.

Remarks

This device should be UsbAudio type and Output direction.

Exceptions
Type Condition
System.InvalidOperationException

This device is not valid or is disconnected.

View Source

GetSupportedSampleRates()

Gets the device's supported sample rates.

Declaration
C#
Copy
public IEnumerable<uint> GetSupportedSampleRates()
Returns
Type Description
System.Collections.Generic.IEnumerable<T><uint>

An IEnumerable<uint> that contains supported sample rates.

Remarks

This device should be UsbAudio type and Output direction.

Exceptions
Type Condition
System.InvalidOperationException

This device is not valid or is disconnected.

View Source

SetAvoidResampling(bool)

Sets the device's 'avoid resampling' property.

Declaration
C#
Copy
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.

View Source

SetMediaStreamOnly(bool)

Sets the restriction of stream type only for media.

Declaration
C#
Copy
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.

View Source

SetSampleFormat(AudioSampleFormat)

Sets the device's sample format.

Declaration
C#
Copy
public void SetSampleFormat(AudioSampleFormat format)
Parameters
Type Name Description
AudioSampleFormat format

The AudioSampleFormat to set to the device.

Remarks

This device should be UsbAudio type and Output direction.

Exceptions
Type Condition
System.InvalidOperationException

This device is not valid or is disconnected.

View Source

SetSampleRate(uint)

Sets the device's sample rate.

Declaration
C#
Copy
public void SetSampleRate(uint rate)
Parameters
Type Name Description
uint rate

The sample rate to set to the device.

Remarks

This device should be UsbAudio type and Output direction.

Exceptions
Type Condition
System.InvalidOperationException

This device is not valid or is disconnected.

View Source

ToString()

Returns a string that represents the current object.

Declaration
C#
Copy
public override string ToString()
Returns
Type Description
string

A string that represents the current object.

Overrides
object.ToString()