Liblinphone: linphone::AudioDevice Class Reference

Liblinphone 5.2.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 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
CapabilityPlay | Can record audio.
CapabilityAll | Can play audio.

## ◆ Type

enum class linphone::AudioDevice::Type
| strong

Type enum represents the different types of an audio device.

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

## 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.

## ◆ 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