Liblinphone  4.5.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  Capabilities {
  CapabilityRecord = 1<<0,
  Capabilities::CapabilityPlay = 1<<1,
  Capabilities::CapabilityAll = 3
}
 Capabilities enum represents whether a device can record audio, play audio or both More...
 
enum  Type {
  Unknown,
  Type::Microphone,
  Type::Earpiece,
  Type::Speaker,
  Type::Bluetooth,
  Type::BluetoothA2DP,
  Type::Telephony,
  Type::AuxLine,
  Type::GenericUsb,
  Type::Headset,
  Type::Headphones
}
 Type enum represents the different types of an audio device. More...
 

Public Member Functions

 AudioDevice (void *ptr, bool takeRef=true)
 
LINPHONECXX_PUBLIC _LinphoneAudioDevice * cPtr ()
 
LINPHONECXX_PUBLIC Capabilities getCapabilities () const
 Returns the capabilities of the device. More...
 
LINPHONECXX_PUBLIC std::string getDeviceName () const
 Returns the name of the audio device. More...
 
LINPHONECXX_PUBLIC std::string getDriverName () const
 Returns the driver name used by the device. More...
 
LINPHONECXX_PUBLIC std::string getId () const
 Returns the id of the audio device. More...
 
LINPHONECXX_PUBLIC Type getType () const
 Returns the type of the device. More...
 
LINPHONECXX_PUBLIC bool hasCapability (Capabilities capability) const
 Returns whether or not the audio device has the given capability. More...
 

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

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

Enumerator
CapabilityPlay 

Can record audio.

CapabilityAll 

Can play audio.

◆ Type

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.

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
capabilitythe 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: