#include "legato.h"
Go to the source code of this file.
Macros | |
#define | LE_AUDIO_DTMF_MAX_LEN 100 |
#define | LE_AUDIO_DTMF_MAX_BYTES 101 |
#define | LE_AUDIO_NO_FD -1 |
#define | LE_AUDIO_GAIN_NAME_MAX_LEN 100 |
#define | LE_AUDIO_GAIN_NAME_MAX_BYTES 101 |
Typedefs | |
typedef struct le_audio_Stream * | le_audio_StreamRef_t |
typedef struct le_audio_Connector * | le_audio_ConnectorRef_t |
typedef struct le_audio_MediaHandler * | le_audio_MediaHandlerRef_t |
typedef struct le_audio_DtmfDetectorHandler * | le_audio_DtmfDetectorHandlerRef_t |
typedef void(* | le_audio_MediaHandlerFunc_t) (le_audio_StreamRef_t streamRef, le_audio_MediaEvent_t event, void *contextPtr) |
typedef void(* | le_audio_DtmfDetectorHandlerFunc_t) (le_audio_StreamRef_t streamRef, char dtmf, void *contextPtr) |
Legato Audio include file.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
#define LE_AUDIO_DTMF_MAX_BYTES 101 |
Maximum DTMF string length. One extra byte is added for the null character.
#define LE_AUDIO_DTMF_MAX_LEN 100 |
Maximum DTMF string length.
#define LE_AUDIO_GAIN_NAME_MAX_BYTES 101 |
Maximum gain's name string length. One extra byte is added for the null character.
#define LE_AUDIO_GAIN_NAME_MAX_LEN 100 |
Maximum gain's name string length.
#define LE_AUDIO_NO_FD -1 |
No file descriptor define
typedef struct le_audio_Connector* le_audio_ConnectorRef_t |
Reference type for Audio Connector
typedef void(* le_audio_DtmfDetectorHandlerFunc_t) (le_audio_StreamRef_t streamRef, char dtmf, void *contextPtr) |
Handler for DTMF decoding.
streamRef | Audio stream reference. |
dtmf | Detected DTMF. |
contextPtr |
typedef struct le_audio_DtmfDetectorHandler* le_audio_DtmfDetectorHandlerRef_t |
Reference type used by Add/Remove functions for EVENT 'le_audio_DtmfDetector'
typedef void(* le_audio_MediaHandlerFunc_t) (le_audio_StreamRef_t streamRef, le_audio_MediaEvent_t event, void *contextPtr) |
Handler for audio stream event.
streamRef | Audio stream reference. |
event | Event value. |
contextPtr |
typedef struct le_audio_MediaHandler* le_audio_MediaHandlerRef_t |
Reference type used by Add/Remove functions for EVENT 'le_audio_Media'
typedef struct le_audio_Stream* le_audio_StreamRef_t |
Reference type for Audio Stream
enum le_audio_AmrMode_t |
AMR mode.
enum le_audio_Format_t |
enum le_audio_Profile_t |
le_audio_DtmfDetectorHandlerRef_t le_audio_AddDtmfDetectorHandler | ( | le_audio_StreamRef_t | streamRef, |
le_audio_DtmfDetectorHandlerFunc_t | handlerPtr, | ||
void * | contextPtr | ||
) |
Add handler function for EVENT 'le_audio_DtmfDetector'
This event provides information on DTMF decoding for the specified streamRef
[in] | streamRef | Audio stream reference. |
[in] | handlerPtr | |
[in] | contextPtr |
le_audio_MediaHandlerRef_t le_audio_AddMediaHandler | ( | le_audio_StreamRef_t | streamRef, |
le_audio_MediaHandlerFunc_t | handlerPtr, | ||
void * | contextPtr | ||
) |
Add handler function for EVENT 'le_audio_Media'
This event provides information on player / recorder stream events.
[in] | streamRef | The audio stream reference. |
[in] | handlerPtr | |
[in] | contextPtr |
void le_audio_Close | ( | le_audio_StreamRef_t | streamRef | ) |
Close an audio stream. If several users own the stream reference, the interface closes only after the last user closes the audio stream.
[in] | streamRef | Audio stream reference. |
le_result_t le_audio_Connect | ( | le_audio_ConnectorRef_t | connectorRef, |
le_audio_StreamRef_t | streamRef | ||
) |
Connect an audio stream to the connector reference.
[in] | connectorRef | Connector reference. |
[in] | streamRef | Audio stream reference. |
void le_audio_ConnectService | ( | void | ) |
Connect the client to the service
le_audio_ConnectorRef_t le_audio_CreateConnector | ( | void | ) |
Create an audio connector reference.
void le_audio_DeleteConnector | ( | le_audio_ConnectorRef_t | connectorRef | ) |
Delete an audio connector reference.
[in] | connectorRef | Connector reference. |
le_result_t le_audio_DisableAutomaticGainControl | ( | le_audio_StreamRef_t | streamRef | ) |
This function must be called to disable the automatic gain control on the selected audio stream.
[in] | streamRef | Audio stream reference. |
le_result_t le_audio_DisableEchoCanceller | ( | le_audio_StreamRef_t | streamRef | ) |
This function must be called to disable the Echo Canceller.
[in] | streamRef | Audio stream reference. |
le_result_t le_audio_DisableFirFilter | ( | le_audio_StreamRef_t | streamRef | ) |
This function must be called to disable the FIR (Finite Impulse Response) filter.
[in] | streamRef | Audio stream reference. |
le_result_t le_audio_DisableIirFilter | ( | le_audio_StreamRef_t | streamRef | ) |
This function must be called to disable the IIR (Infinite Impulse Response) filter.
[in] | streamRef | Audio stream reference. |
le_result_t le_audio_DisableNoiseSuppressor | ( | le_audio_StreamRef_t | streamRef | ) |
This function must be called to disable the Noise Suppressor.
[in] | streamRef | Audio stream reference. |
void le_audio_Disconnect | ( | le_audio_ConnectorRef_t | connectorRef, |
le_audio_StreamRef_t | streamRef | ||
) |
Disconnect an audio stream from the connector reference.
[in] | connectorRef | Connector reference. |
[in] | streamRef | Audio stream reference. |
void le_audio_DisconnectService | ( | void | ) |
Disconnect the client from the service
le_result_t le_audio_EnableAutomaticGainControl | ( | le_audio_StreamRef_t | streamRef | ) |
This function must be called to enable the automatic gain control on the selected audio stream.
[in] | streamRef | Audio stream reference. |
le_result_t le_audio_EnableEchoCanceller | ( | le_audio_StreamRef_t | streamRef | ) |
This function must be called to enable the Echo Canceller.
[in] | streamRef | Audio stream reference. |
le_result_t le_audio_EnableFirFilter | ( | le_audio_StreamRef_t | streamRef | ) |
This function must be called to enable the FIR (Finite Impulse Response) filter.
[in] | streamRef | Audio stream reference. |
le_result_t le_audio_EnableIirFilter | ( | le_audio_StreamRef_t | streamRef | ) |
This function must be called to enable the IIR (Infinite Impulse Response) filter.
[in] | streamRef | Audio stream reference. |
le_result_t le_audio_EnableNoiseSuppressor | ( | le_audio_StreamRef_t | streamRef | ) |
This function must be called to enable the Noise Suppressor.
[in] | streamRef | Audio stream reference. |
le_result_t le_audio_Flush | ( | le_audio_StreamRef_t | streamRef | ) |
Flush the remaining audio samples.
[in] | streamRef | Audio stream reference. |
le_audio_I2SChannel_t le_audio_GetDefaultI2sMode | ( | void | ) |
Get the default I2S channel mode used on the current platform.
uint32_t le_audio_GetDefaultPcmTimeSlot | ( | void | ) |
Get the default PCM time slot used on the current platform.
le_result_t le_audio_GetEncodingFormat | ( | le_audio_StreamRef_t | streamRef, |
le_audio_Format_t * | formatPtr | ||
) |
Get the encoding format of a recorder stream.
[in] | streamRef | Audio stream reference. |
[out] | formatPtr | Encoding format. |
le_result_t le_audio_GetGain | ( | le_audio_StreamRef_t | streamRef, |
uint32_t * | gainPtr | ||
) |
Get the Gain value of an input or output stream.
[in] | streamRef | Audio stream reference. |
[out] | gainPtr | Gain value [0..100] (0 means 'muted', 100 is the maximum gain value) |
le_audio_Companding_t le_audio_GetPcmCompanding | ( | void | ) |
Retrieve the PCM Companding.
uint32_t le_audio_GetPcmSamplingRate | ( | void | ) |
Retrieve the PCM Sampling Rate.
uint32_t le_audio_GetPcmSamplingResolution | ( | void | ) |
Retrieve the PCM Sampling Resolution.
le_result_t le_audio_GetPlatformSpecificGain | ( | const char * | gainName, |
uint32_t * | gainPtr | ||
) |
Get the value of a platform specific gain in the audio subsystem.
[in] | gainName | Name of the platform specific gain. |
[out] | gainPtr | The gain value (specific to the platform) |
le_result_t le_audio_GetProfile | ( | le_audio_Profile_t * | profilePtr | ) |
This function must be called to get the audio profile in use.
[out] | profilePtr | Audio profile. |
le_result_t le_audio_GetSampleAmrDtx | ( | le_audio_StreamRef_t | streamRef, |
bool * | dtxPtr | ||
) |
Get the AMR discontinuous transmission (DTX) value.
[in] | streamRef | Audio stream reference. |
[out] | dtxPtr | DTX. |
le_result_t le_audio_GetSampleAmrMode | ( | le_audio_StreamRef_t | streamRef, |
le_audio_AmrMode_t * | modePtr | ||
) |
Get the AMR mode for AMR encoder.
[in] | streamRef | Audio stream reference. |
[out] | modePtr | AMR mode. |
le_result_t le_audio_GetSamplePcmChannelNumber | ( | le_audio_StreamRef_t | streamRef, |
uint32_t * | nbChannelPtr | ||
) |
Get the channel number of a PCM sample.
[in] | streamRef | Audio stream reference. |
[out] | nbChannelPtr | Channel Number |
le_result_t le_audio_GetSamplePcmSamplingRate | ( | le_audio_StreamRef_t | streamRef, |
uint32_t * | ratePtr | ||
) |
Get the PCM sampling rate of a PCM sample.
[in] | streamRef | Audio stream reference. |
[out] | ratePtr | PCM sampling Rate. |
le_result_t le_audio_GetSamplePcmSamplingResolution | ( | le_audio_StreamRef_t | streamRef, |
uint32_t * | samplingResPtr | ||
) |
Get the sampling resolution (in bits per sample) of a PCM sample.
[in] | streamRef | Audio stream reference. |
[out] | samplingResPtr | Sampling resolution (in bits per sample). |
le_result_t le_audio_GetSamples | ( | le_audio_StreamRef_t | streamRef, |
int | fd | ||
) |
Get samples from a recorder stream.
[in] | streamRef | Audio stream reference. |
[in] | fd | File descriptor. |
le_result_t le_audio_Mute | ( | le_audio_StreamRef_t | streamRef | ) |
Mute an audio stream.
[in] | streamRef | Audio stream reference. |
le_audio_StreamRef_t le_audio_OpenI2sRx | ( | le_audio_I2SChannel_t | mode | ) |
Open the received audio stream of the I2S interface.
[in] | mode | The channel mode. |
le_audio_StreamRef_t le_audio_OpenI2sTx | ( | le_audio_I2SChannel_t | mode | ) |
Open the transmitted audio stream of the I2S interface.
[in] | mode | The channel mode. |
le_audio_StreamRef_t le_audio_OpenMic | ( | void | ) |
Open the Microphone.
le_audio_StreamRef_t le_audio_OpenModemVoiceRx | ( | void | ) |
Open the received audio stream of a voice call.
le_audio_StreamRef_t le_audio_OpenModemVoiceTx | ( | void | ) |
Open the transmitted audio stream of a voice call.
le_audio_StreamRef_t le_audio_OpenPcmRx | ( | uint32_t | timeslot | ) |
Open the received audio stream of the PCM interface.
[in] | timeslot | The time slot number. |
le_audio_StreamRef_t le_audio_OpenPcmTx | ( | uint32_t | timeslot | ) |
Open the transmitted audio stream of the PCM interface.
[in] | timeslot | The time slot number. |
le_audio_StreamRef_t le_audio_OpenPlayer | ( | void | ) |
Open the audio stream for playback.
le_audio_StreamRef_t le_audio_OpenRecorder | ( | void | ) |
Open the audio stream for recording.
le_audio_StreamRef_t le_audio_OpenSpeaker | ( | void | ) |
Open the Speakerphone.
le_audio_StreamRef_t le_audio_OpenUsbRx | ( | void | ) |
Open the received audio stream of an USB audio class.
le_audio_StreamRef_t le_audio_OpenUsbTx | ( | void | ) |
Open the transmitted audio stream of an USB audio class.
le_result_t le_audio_Pause | ( | le_audio_StreamRef_t | streamRef | ) |
Pause the file playback/recording.
[in] | streamRef | Audio stream reference. |
le_result_t le_audio_PlayDtmf | ( | le_audio_StreamRef_t | streamRef, |
const char * | dtmf, | ||
uint32_t | duration, | ||
uint32_t | pause | ||
) |
This function must be called to play a DTMF on a specific audio stream.
[in] | streamRef | Audio stream reference. |
[in] | dtmf | DTMFs to play. |
[in] | duration | DTMF duration in milliseconds. |
[in] | pause | Pause duration between tones in milliseconds. |
le_result_t le_audio_PlayFile | ( | le_audio_StreamRef_t | streamRef, |
int | fd | ||
) |
Play a file on a playback stream.
[in] | streamRef | Audio stream reference. |
[in] | fd | File descriptor. |
le_result_t le_audio_PlaySamples | ( | le_audio_StreamRef_t | streamRef, |
int | fd | ||
) |
Initiate a playback sending samples over a pipe.
[in] | streamRef | Audio stream reference. |
[in] | fd | File descriptor. |
le_result_t le_audio_PlaySignallingDtmf | ( | const char * | dtmf, |
uint32_t | duration, | ||
uint32_t | pause | ||
) |
This function must be called to ask to the Mobile Network to generate on the remote audio party the DTMFs.
[in] | dtmf | DTMFs to play. |
[in] | duration | DTMF duration in milliseconds. |
[in] | pause | Pause duration between tones in milliseconds. |
le_result_t le_audio_RecordFile | ( | le_audio_StreamRef_t | streamRef, |
int | fd | ||
) |
Record a file on a recorder stream.
[in] | streamRef | Audio stream reference. |
[in] | fd | File descriptor. |
void le_audio_RemoveDtmfDetectorHandler | ( | le_audio_DtmfDetectorHandlerRef_t | addHandlerRef | ) |
Remove handler function for EVENT 'le_audio_DtmfDetector'
[in] | addHandlerRef |
void le_audio_RemoveMediaHandler | ( | le_audio_MediaHandlerRef_t | addHandlerRef | ) |
Remove handler function for EVENT 'le_audio_Media'
[in] | addHandlerRef |
le_result_t le_audio_Resume | ( | le_audio_StreamRef_t | streamRef | ) |
Resume a file playback/recording (need to be in pause state).
[in] | streamRef | Audio stream reference. |
le_result_t le_audio_SetEncodingFormat | ( | le_audio_StreamRef_t | streamRef, |
le_audio_Format_t | format | ||
) |
Set the encoding format of a recorder stream.
[in] | streamRef | Audio stream reference. |
[in] | format | Encoding format. |
le_result_t le_audio_SetGain | ( | le_audio_StreamRef_t | streamRef, |
uint32_t | gain | ||
) |
Set the Gain value of an input or output stream.
[in] | streamRef | Audio stream reference. |
[in] | gain | Gain value [0..100] (0 means 'muted', 100 is the maximum gain value) |
le_result_t le_audio_SetPcmCompanding | ( | le_audio_Companding_t | companding | ) |
Configure the PCM Companding.
[in] | companding | Companding. |
le_result_t le_audio_SetPcmSamplingRate | ( | uint32_t | rate | ) |
Configure the PCM Sampling Rate.
[in] | rate | Sampling rate in Hz. |
le_result_t le_audio_SetPcmSamplingResolution | ( | uint32_t | bitsPerSample | ) |
Configure the PCM Sampling Resolution.
[in] | bitsPerSample | Sampling resolution (bits/sample). |
le_result_t le_audio_SetPlatformSpecificGain | ( | const char * | gainName, |
uint32_t | gain | ||
) |
Set the value of a platform specific gain in the audio subsystem.
[in] | gainName | Name of the platform specific gain. |
[in] | gain | The gain value (specific to the platform) |
le_result_t le_audio_SetProfile | ( | le_audio_Profile_t | profile | ) |
This function must be called to set the audio profile.
[in] | profile | Audio profile. |
le_result_t le_audio_SetSampleAmrDtx | ( | le_audio_StreamRef_t | streamRef, |
bool | dtx | ||
) |
Set the AMR discontinuous transmission (DTX). The DTX is activated by default.
[in] | streamRef | Audio stream reference. |
[in] | dtx | DTX. |
le_result_t le_audio_SetSampleAmrMode | ( | le_audio_StreamRef_t | streamRef, |
le_audio_AmrMode_t | mode | ||
) |
Set the AMR mode for AMR encoder.
[in] | streamRef | Audio stream reference. |
[in] | mode | AMR mode. |
le_result_t le_audio_SetSamplePcmChannelNumber | ( | le_audio_StreamRef_t | streamRef, |
uint32_t | nbChannel | ||
) |
Set the channel number of a PCM sample.
[in] | streamRef | Audio stream reference. |
[in] | nbChannel | Channel Number |
le_result_t le_audio_SetSamplePcmSamplingRate | ( | le_audio_StreamRef_t | streamRef, |
uint32_t | rate | ||
) |
Set the PCM sampling rate of a PCM sample.
[in] | streamRef | Audio stream reference. |
[in] | rate | PCM sampling Rate. |
le_result_t le_audio_SetSamplePcmSamplingResolution | ( | le_audio_StreamRef_t | streamRef, |
uint32_t | samplingRes | ||
) |
Set the sampling resolution (in bits per sample) of a PCM sample.
[in] | streamRef | Audio stream reference. |
[in] | samplingRes | Sampling resolution (in bits per sample). |
le_result_t le_audio_Stop | ( | le_audio_StreamRef_t | streamRef | ) |
Stop the file playback/recording.
[in] | streamRef | Audio stream reference. |
le_result_t le_audio_Unmute | ( | le_audio_StreamRef_t | streamRef | ) |
Unmute an audio stream.
[in] | streamRef | Audio stream reference. |