Class AudioDevice

Definition

Namespace:
Tizen.Multimedia
Assembly:
Tizen.Multimedia.dll
API Level:
3

Provides the ability to query the information of sound devices.

C#
Copy
public class AudioDevice
Inheritance
System.Object
AudioDevice

Properties

View Source

Id

Gets the ID of the device.

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

The id of the device.

API Level: 3
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.

API Level: 3
View Source

IsRunning

Gets the running state of the device.

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

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

API Level: 5
View Source

Name

Gets the name of the device.

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

The name of the device.

API Level: 3
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.

API Level: 3

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
System.Object obj

A System.Object to compare.

Returns
Type Description
System.Boolean

true if the two devices are equal; otherwise, false.

Overrides
System.Object.Equals(System.Object)
API Level: 4
View Source

GetAvoidResampling()

Gets the device's 'avoid resampling' property.

Declaration
C#
Copy
public bool GetAvoidResampling()
Returns
Type Description
System.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
System.InvalidOperationException

This device is not valid or is disconnected.

API Level: 5
View Source

GetHashCode()

Gets the hash code for this instance of AudioDevice.

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

The hash code for this instance of AudioDevice.

Overrides
System.Object.GetHashCode()
API Level: 4
View Source

GetMediaStreamOnly()

Gets the restriction of stream type only for media.

Declaration
C#
Copy
public bool GetMediaStreamOnly()
Returns
Type Description
System.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
System.InvalidOperationException

This device is not valid or is disconnected.

API Level: 5
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.

API Level: 5
View Source

GetSampleRate()

Gets the device's sample rate.

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

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.

API Level: 5
View Source

GetSupportedSampleFormats()

Gets the device's supported sample formats.

Declaration
C#
Copy
public IEnumerable<AudioSampleFormat> GetSupportedSampleFormats()
Returns
Type Description
System.Collections.Generic.IEnumerable<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.

API Level: 5
View Source

GetSupportedSampleRates()

Gets the device's supported sample rates.

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

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.

API Level: 5
View Source

SetAvoidResampling(Boolean)

Sets the device's 'avoid resampling' property.

Declaration
C#
Copy
public void SetAvoidResampling(bool enable)
Parameters
Type Name Description
System.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
System.InvalidOperationException

This device is not valid or is disconnected.

API Level: 5
View Source

SetMediaStreamOnly(Boolean)

Sets the restriction of stream type only for media.

Declaration
C#
Copy
public void SetMediaStreamOnly(bool enable)
Parameters
Type Name Description
System.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
System.InvalidOperationException

This device is not valid or is disconnected.

API Level: 5
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.

API Level: 5
View Source

SetSampleRate(UInt32)

Sets the device's sample rate.

Declaration
C#
Copy
public void SetSampleRate(uint rate)
Parameters
Type Name Description
System.UInt32 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.

API Level: 5
View Source

ToString()

Returns a string that represents the current object.

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

A string that represents the current object.

Overrides
API Level: 4