Package org.linphone.core

# Interface AudioDevice

public interface AudioDevice
Object holding audio device information.
It contains the name of the device, it's type if available (Earpiece, Speaker,
Bluetooth, etc..) and capabilities (input, output or both) the name of the
driver that created it (filter in mediastreamer).
You can use the `AudioDevice` objects to configure default input/output
devices or do it dynamically during a call.
To get the list of available devices, use `Core.getAudioDevices()`. This
list will be limited to one device of each type. Use `Core.getExtendedAudioDevices()`
for a complete list.

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static enum`
`AudioDevice.Capabilities`
`static enum`
`AudioDevice.Type`

## Method Summary

Modifier and Type
Method
Description
`AudioDevice.Capabilities`
`getCapabilities()`
Returns the capabilities of the device.
`String`
`getDeviceName()`
Returns the name of the audio device.
`String`
`getDriverName()`
Returns the driver name used by the device.
`boolean`
`getFollowsSystemRoutingPolicy()`
Returns whether the audio device automatically follows the system's audio
routing policy.
`String`
`getId()`
Returns the id of the audio device.
`long`
`getNativePointer()`
Gets the native pointer used by this class to make native method calls.
`AudioDevice.Type`
`getType()`
Returns the type of the device.
`boolean`
`getUseForRinging()`
Returns whether the audio device is used to play the ringtone or not.
`Object`
`getUserData()`
Gets the object stored in this object user's data
`boolean`
`hasCapability(AudioDevice.Capabilities capability)`
Returns whether or not the audio device has the given capability.
`void`
`setUseForRinging(boolean useForRinging)`
Tells the audio device to be used to play the ringtone or not.
`void`
`setUserData(Object data)`
Sets the object to store in this object user's data
`String`
`toString()`

## Method Details

### getCapabilities

AudioDevice.Capabilities getCapabilities()
Returns the capabilities of the device.

Returns:
  the `AudioDevice.Capabilities` of the audio device (RECORD, PLAY or both) as
  a bit mask

### getDeviceName

@NonNull String getDeviceName()
Returns the name of the audio device.

Returns:
  the name of the audio device.

### getDriverName

@NonNull String getDriverName()
Returns the driver name used by the device.

Returns:
  the name of the driver used by this audio device.

### getFollowsSystemRoutingPolicy

boolean getFollowsSystemRoutingPolicy()
Returns whether the audio device automatically follows the system's audio
routing policy.
This capability is available on some system (typically iOS) and might be
convenient to simply specify liblinphone to let the system decide about which
audio route is being used to handle a call. The actual `AudioDevice.Type` may be
unknown at some point, typically when no calls are running, otherwise it is
reflected to be the actual system's audio route.

Returns:
  true if the audio device automatically follows the system audio routing
  policy.

### getId

@NonNull String getId()
Returns the id of the audio device.

Returns:
  the id of the audio device.

### getType

AudioDevice.Type getType()
Returns the type of the device.

Returns:
  the `AudioDevice.Type` of the audio device (microphone, speaker, earpiece,
  bluetooth, etc...)

### getUseForRinging

boolean getUseForRinging()
Returns whether the audio device is used to play the ringtone or not.

Returns:
  Whether the audio device is used to play the ringtone or not.

### setUseForRinging

void setUseForRinging(boolean useForRinging)
Tells the audio device to be used to play the ringtone or not.

Parameters:
  `useForRinging` - Whether the audio device must be used to play the ringtone
  or not.

### hasCapability

boolean hasCapability(AudioDevice.Capabilities capability)
Returns whether or not the audio device has the given capability.

Parameters:
  `capability` - the `AudioDevice.Capabilities` to check
Returns:
  true if the audio device has the capability, false otherwise

### setUserData

void setUserData(Object data)
Sets the object to store in this object user's data

Parameters:
  `data` - the object to store

### getUserData

Object getUserData()
Gets the object stored in this object user's data

Returns:
  the object store if any, null otherwise

### getNativePointer

long getNativePointer()
Gets the native pointer used by this class to make native method calls.

Returns:
  the nativer pointer, as long

### toString

String toString()

Overrides:
  `toString` in class `Object`