Liblinphone 5.3.0

Public Types | Public Member Functions | List of all members
linphone::AudioDevice Class Reference

Object holding audio device information. More...

`#include <audio_device.hh>`

Inheritance diagram for linphone::AudioDevice:

## Public Types
enum class | Capabilities { CapabilityRecord = 1<<0 , CapabilityPlay = 1<<1 , CapabilityAll = 3 }
| Capabilities enum represents whether a device can record audio, play audio or both More...
enum class | Type { Unknown = 0 , Microphone = 1 , Earpiece = 2 , Speaker = 3 , Bluetooth = 4 , BluetoothA2DP = 5 , Telephony = 6 , AuxLine = 7 , GenericUsb = 8 , Headset = 9 , Headphones = 10 , HearingAid = 11 }
| Type enum represents the different types of an audio device. More...

## Public Member Functions
LINPHONECXX_PUBLIC | AudioDevice (void *ptr, bool takeRef=true)
LINPHONECXX_PUBLIC _LinphoneAudioDevice * | cPtr ()
LINPHONECXX_PUBLIC Capabilities | getCapabilities () const
| Returns the capabilities of the device.
LINPHONECXX_PUBLIC std::string | getDeviceName () const
| Returns the name of the audio device.
LINPHONECXX_PUBLIC std::string | getDriverName () const
| Returns the driver name used by the device.
LINPHONECXX_PUBLIC bool | getFollowsSystemRoutingPolicy () const
| Returns whether the audio device automatically follows the system's audio routing policy.
LINPHONECXX_PUBLIC std::string | getId () const
| Returns the id of the audio device.
LINPHONECXX_PUBLIC Type | getType () const
| Returns the type of the device.
LINPHONECXX_PUBLIC bool | hasCapability (Capabilities capability) const
| Returns whether or not the audio device has the given capability.

## Detailed Description

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.

## Member Enumeration Documentation

## ◆ Capabilities

enum class linphone::AudioDevice::Capabilities
| strong

Capabilities enum represents whether a device can record audio, play audio or both

Enumerator
CapabilityRecord | Can record audio.
CapabilityPlay | Can play audio.
CapabilityAll | Can play and record audio.

## ◆ Type

enum class linphone::AudioDevice::Type
| strong

Type enum represents the different types of an audio device.

Enumerator
Unknown | Unknown.
Microphone | Microphone.
Earpiece | Earpiece.
Speaker | Speaker.
Bluetooth | Bluetooth.
BluetoothA2DP | Bluetooth A2DP.
Telephony | Telephony.
AuxLine | AuxLine.
GenericUsb | GenericUsb.
Headset | Headset.
Headphones | Headphones.
HearingAid | Hearing Aid.

## Member Function Documentation

## ◆ getCapabilities()

LINPHONECXX_PUBLIC Capabilities linphone::AudioDevice::getCapabilities | ( |  | ) | const

Returns the capabilities of the device.

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

## ◆ getDeviceName()

LINPHONECXX_PUBLIC std::string linphone::AudioDevice::getDeviceName | ( |  | ) | const

Returns the name of the audio device.

Returns
  the name of the audio device.

## ◆ getDriverName()

LINPHONECXX_PUBLIC std::string linphone::AudioDevice::getDriverName | ( |  | ) | const

Returns the driver name used by the device.

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

## ◆ getFollowsSystemRoutingPolicy()

LINPHONECXX_PUBLIC bool linphone::AudioDevice::getFollowsSystemRoutingPolicy | ( |  | ) | const

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 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()

LINPHONECXX_PUBLIC std::string linphone::AudioDevice::getId | ( |  | ) | const

Returns the id of the audio device.

Returns
  the id of the audio device.

## ◆ getType()

LINPHONECXX_PUBLIC Type linphone::AudioDevice::getType | ( |  | ) | const

Returns the type of the device.

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

## ◆ hasCapability()

LINPHONECXX_PUBLIC bool linphone::AudioDevice::hasCapability | ( | Capabilities | capability | ) | const

Returns whether or not the audio device has the given capability.

Parameters

  capability | the Capabilities to check

Returns
  true if the audio device has the capability, false otherwise

The documentation for this class was generated from the following file:

- audio_device.hh