Liblinphone: Audio

Liblinphone 5.2.0

Typedefs | Enumerations | Functions
Audio

## Typedefs
typedef struct _LinphoneAudioDevice | LinphoneAudioDevice
| Object holding audio device information.
typedef enum _LinphoneAudioDeviceType | LinphoneAudioDeviceType
| LinphoneAudioDeviceType enum represents the different types of an audio device.
typedef enum _LinphoneAudioDeviceCapabilities | LinphoneAudioDeviceCapabilities
| LinphoneAudioDeviceCapabilities enum represents whether a device can record audio, play audio or both

## Enumerations
enum | _LinphoneAudioDeviceType { LinphoneAudioDeviceTypeUnknown = 0 , LinphoneAudioDeviceTypeMicrophone = 1 , LinphoneAudioDeviceTypeEarpiece = 2 , LinphoneAudioDeviceTypeSpeaker = 3 , LinphoneAudioDeviceTypeBluetooth = 4 , LinphoneAudioDeviceTypeBluetoothA2DP = 5 , LinphoneAudioDeviceTypeTelephony = 6 , LinphoneAudioDeviceTypeAuxLine = 7 , LinphoneAudioDeviceTypeGenericUsb = 8 , LinphoneAudioDeviceTypeHeadset = 9 , LinphoneAudioDeviceTypeHeadphones = 10 , LinphoneAudioDeviceTypeHearingAid = 11 }
| LinphoneAudioDeviceType enum represents the different types of an audio device. More...
enum | _LinphoneAudioDeviceCapabilities { LinphoneAudioDeviceCapabilityRecord = 1 << 0 , LinphoneAudioDeviceCapabilityPlay = 1 << 1 , LinphoneAudioDeviceCapabilityAll = 3 }
| LinphoneAudioDeviceCapabilities enum represents whether a device can record audio, play audio or both More...

## Functions
bctbx_list_t * | linphone_core_get_audio_devices (const LinphoneCore *core)
| Returns a list of audio devices, with only the first device for each type To have the list of all audio devices, use linphone_core_get_extended_audio_devices()
bctbx_list_t * | linphone_core_get_extended_audio_devices (const LinphoneCore *core)
| Returns the list of all audio devices.
void | linphone_core_set_input_audio_device (LinphoneCore *core, LinphoneAudioDevice *audio_device)
| Sets the given LinphoneAudioDevice as input for all active calls.
void | linphone_core_set_output_audio_device (LinphoneCore *core, LinphoneAudioDevice *audio_device)
| Sets the given LinphoneAudioDevice as output for all active calls.
const LinphoneAudioDevice * | linphone_core_get_input_audio_device (const LinphoneCore *core)
| Gets the input audio device for the current call.
const LinphoneAudioDevice * | linphone_core_get_output_audio_device (const LinphoneCore *core)
| Gets the output audio device for the current call.
void | linphone_core_set_default_input_audio_device (LinphoneCore *core, LinphoneAudioDevice *audio_device)
| Sets the given LinphoneAudioDevice as default input for next calls.
void | linphone_core_set_default_output_audio_device (LinphoneCore *core, LinphoneAudioDevice *audio_device)
| Sets the given LinphoneAudioDevice as default output for next calls.
const LinphoneAudioDevice * | linphone_core_get_default_input_audio_device (const LinphoneCore *core)
| Gets the default input audio device.
const LinphoneAudioDevice * | linphone_core_get_default_output_audio_device (const LinphoneCore *core)
| Gets the default output audio device.
const char * | linphone_audio_device_get_id (const LinphoneAudioDevice *audio_device)
| Returns the id of the audio device.
const char * | linphone_audio_device_get_device_name (const LinphoneAudioDevice *audio_device)
| Returns the name of the audio device.
const char * | linphone_audio_device_get_driver_name (const LinphoneAudioDevice *audio_device)
| Returns the driver name used by the device.
LinphoneAudioDeviceCapabilities | linphone_audio_device_get_capabilities (const LinphoneAudioDevice *audio_device)
| Returns the capabilities of the device.
LinphoneAudioDeviceType | linphone_audio_device_get_type (const LinphoneAudioDevice *audio_device)
| Returns the type of the device.
bool_t | linphone_audio_device_has_capability (const LinphoneAudioDevice *audio_device, const LinphoneAudioDeviceCapabilities capability)
| Returns whether or not the audio device has the given capability.
LinphoneAudioDevice * | linphone_audio_device_ref (LinphoneAudioDevice *audio_device)
| Takes a reference on a LinphoneAudioDevice.
void | linphone_audio_device_unref (LinphoneAudioDevice *audio_device)
| Releases a LinphoneAudioDevice.

## Detailed Description

## Typedef Documentation

## ◆ LinphoneAudioDevice

typedef struct _LinphoneAudioDevice LinphoneAudioDevice

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 LinphoneAudioDevice objects to configure default input/output devices or do it dynamically during a call.

To get the list of available devices, use linphone_core_get_audio_devices(). This list will be limited to one device of each type. Use linphone_core_get_extended_audio_devices() for a complete list.

## Enumeration Type Documentation

## ◆ _LinphoneAudioDeviceCapabilities

enum _LinphoneAudioDeviceCapabilities

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

Enumerator
LinphoneAudioDeviceCapabilityPlay | Can record audio.
LinphoneAudioDeviceCapabilityAll | Can play audio.

## ◆ _LinphoneAudioDeviceType

enum _LinphoneAudioDeviceType

LinphoneAudioDeviceType enum represents the different types of an audio device.

Enumerator
LinphoneAudioDeviceTypeMicrophone | Unknown.
LinphoneAudioDeviceTypeEarpiece | Microphone.
LinphoneAudioDeviceTypeSpeaker | Earpiece.
LinphoneAudioDeviceTypeBluetooth | Speaker.
LinphoneAudioDeviceTypeBluetoothA2DP | Bluetooth.
LinphoneAudioDeviceTypeTelephony | Bluetooth A2DP.
LinphoneAudioDeviceTypeAuxLine | Telephony.
LinphoneAudioDeviceTypeGenericUsb | AuxLine.
LinphoneAudioDeviceTypeHeadset | GenericUsb.
LinphoneAudioDeviceTypeHeadphones | Headset.
LinphoneAudioDeviceTypeHearingAid | Headphones.

## Function Documentation

## ◆ linphone_audio_device_get_capabilities()

LinphoneAudioDeviceCapabilities linphone_audio_device_get_capabilities | ( | const LinphoneAudioDevice * | audio_device | ) |

Returns the capabilities of the device.

Parameters

  audio_device | the LinphoneAudioDevice.

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

## ◆ linphone_audio_device_get_device_name()

const char * linphone_audio_device_get_device_name | ( | const LinphoneAudioDevice * | audio_device | ) |

Returns the name of the audio device.

Parameters

  audio_device | the LinphoneAudioDevice.

Returns
  the name of the audio device.

## ◆ linphone_audio_device_get_driver_name()

const char * linphone_audio_device_get_driver_name | ( | const LinphoneAudioDevice * | audio_device | ) |

Returns the driver name used by the device.

Parameters

  audio_device | the LinphoneAudioDevice.

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

## ◆ linphone_audio_device_get_id()

const char * linphone_audio_device_get_id | ( | const LinphoneAudioDevice * | audio_device | ) |

Returns the id of the audio device.

Parameters

  audio_device | the LinphoneAudioDevice.

Returns
  the id of the audio device.

## ◆ linphone_audio_device_get_type()

LinphoneAudioDeviceType linphone_audio_device_get_type | ( | const LinphoneAudioDevice * | audio_device | ) |

Returns the type of the device.

Parameters

  audio_device | the LinphoneAudioDevice.

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

## ◆ linphone_audio_device_has_capability()

bool_t linphone_audio_device_has_capability | ( | const LinphoneAudioDevice * | audio_device,
|  | const LinphoneAudioDeviceCapabilities | capability
| ) |  |

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

Parameters

  audio_device | the LinphoneAudioDevice.
  capability | the LinphoneAudioDeviceCapabilities to check

Returns
  TRUE if the audio device has the capability, FALSE otherwise

## ◆ linphone_audio_device_ref()

LinphoneAudioDevice * linphone_audio_device_ref | ( | LinphoneAudioDevice * | audio_device | ) |

Takes a reference on a LinphoneAudioDevice.

Parameters

  audio_device | the LinphoneAudioDevice.

Returns
  the same LinphoneAudioDevice object

## ◆ linphone_audio_device_unref()

void linphone_audio_device_unref | ( | LinphoneAudioDevice * | audio_device | ) |

Releases a LinphoneAudioDevice.

Parameters

  audio_device | the LinphoneAudioDevice.

## ◆ linphone_core_get_audio_devices()

bctbx_list_t * linphone_core_get_audio_devices | ( | const LinphoneCore * | core | ) |

Returns a list of audio devices, with only the first device for each type To have the list of all audio devices, use linphone_core_get_extended_audio_devices()

Parameters

  core | The LinphoneCore

Returns
  A list with the first LinphoneAudioDevice of each type

## ◆ linphone_core_get_default_input_audio_device()

const LinphoneAudioDevice * linphone_core_get_default_input_audio_device | ( | const LinphoneCore * | core | ) |

Gets the default input audio device.

Parameters

  core | The LinphoneCore

Returns
  The default input audio device

## ◆ linphone_core_get_default_output_audio_device()

const LinphoneAudioDevice * linphone_core_get_default_output_audio_device | ( | const LinphoneCore * | core | ) |

Gets the default output audio device.

Parameters

  core | The LinphoneCore

Returns
  The default output audio device

## ◆ linphone_core_get_extended_audio_devices()

bctbx_list_t * linphone_core_get_extended_audio_devices | ( | const LinphoneCore * | core | ) |

Returns the list of all audio devices.

Parameters

  core | The LinphoneCore

Returns
  A list of all LinphoneAudioDevice

## ◆ linphone_core_get_input_audio_device()

const LinphoneAudioDevice * linphone_core_get_input_audio_device | ( | const LinphoneCore * | core | ) |

Gets the input audio device for the current call.

Parameters

  core | The LinphoneCore

Returns
  The input audio device for the current or first call, NULL if there is no call.

## ◆ linphone_core_get_output_audio_device()

const LinphoneAudioDevice * linphone_core_get_output_audio_device | ( | const LinphoneCore * | core | ) |

Gets the output audio device for the current call.

Parameters

  core | The LinphoneCore

Returns
  The output audio device for the current or first call, NULL if there is no call.

## ◆ linphone_core_set_default_input_audio_device()

void linphone_core_set_default_input_audio_device | ( | LinphoneCore * | core,
|  | LinphoneAudioDevice * | audio_device
| ) |  |

Sets the given LinphoneAudioDevice as default input for next calls.

Parameters

  core | The LinphoneCore
  audio_device | The LinphoneAudioDevice

## ◆ linphone_core_set_default_output_audio_device()

void linphone_core_set_default_output_audio_device | ( | LinphoneCore * | core,
|  | LinphoneAudioDevice * | audio_device
| ) |  |

Sets the given LinphoneAudioDevice as default output for next calls.

Parameters

  core | The LinphoneCore
  audio_device | The LinphoneAudioDevice

## ◆ linphone_core_set_input_audio_device()

void linphone_core_set_input_audio_device | ( | LinphoneCore * | core,
|  | LinphoneAudioDevice * | audio_device
| ) |  |

Sets the given LinphoneAudioDevice as input for all active calls.

Parameters

  core | The LinphoneCore
  audio_device | The LinphoneAudioDevice. NULL does nothing.

## ◆ linphone_core_set_output_audio_device()

void linphone_core_set_output_audio_device | ( | LinphoneCore * | core,
|  | LinphoneAudioDevice * | audio_device
| ) |  |

Sets the given LinphoneAudioDevice as output for all active calls.

Parameters

  core | The LinphoneCore
  audio_device | The LinphoneAudioDevice. NULL does nothing.