le_audio_interface.h File Reference

#include "legato.h"
#include "le_audio_common.h"

Go to the source code of this file.

Typedefs

typedef void(* le_audio_DisconnectHandler_t) (void *)
 

Functions

void le_audio_ConnectService (void)
 
le_result_t le_audio_TryConnectService (void)
 
LE_FULL_API void le_audio_SetServerDisconnectHandler (le_audio_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void le_audio_DisconnectService (void)
 
le_audio_StreamRef_t le_audio_OpenMic (void)
 
le_audio_StreamRef_t le_audio_OpenSpeaker (void)
 
le_audio_StreamRef_t le_audio_OpenUsbRx (void)
 
le_audio_StreamRef_t le_audio_OpenUsbTx (void)
 
le_audio_StreamRef_t le_audio_OpenPcmRx (uint32_t timeslot)
 
le_audio_StreamRef_t le_audio_OpenPcmTx (uint32_t timeslot)
 
le_audio_StreamRef_t le_audio_OpenI2sRx (le_audio_I2SChannel_t mode)
 
le_audio_StreamRef_t le_audio_OpenI2sTx (le_audio_I2SChannel_t mode)
 
le_audio_StreamRef_t le_audio_OpenPlayer (void)
 
le_audio_StreamRef_t le_audio_OpenRecorder (void)
 
le_audio_StreamRef_t le_audio_OpenModemVoiceRx (void)
 
le_audio_StreamRef_t le_audio_OpenModemVoiceTx (void)
 
le_audio_MediaHandlerRef_t le_audio_AddMediaHandler (le_audio_StreamRef_t streamRef, le_audio_MediaHandlerFunc_t handlerPtr, void *contextPtr)
 
void le_audio_RemoveMediaHandler (le_audio_MediaHandlerRef_t handlerRef)
 
void le_audio_Close (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_SetGain (le_audio_StreamRef_t streamRef, int32_t gain)
 
le_result_t le_audio_GetGain (le_audio_StreamRef_t streamRef, int32_t *gainPtr)
 
le_result_t le_audio_Mute (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_Unmute (le_audio_StreamRef_t streamRef)
 
le_audio_ConnectorRef_t le_audio_CreateConnector (void)
 
void le_audio_DeleteConnector (le_audio_ConnectorRef_t connectorRef)
 
le_result_t le_audio_Connect (le_audio_ConnectorRef_t connectorRef, le_audio_StreamRef_t streamRef)
 
void le_audio_Disconnect (le_audio_ConnectorRef_t connectorRef, le_audio_StreamRef_t streamRef)
 
le_audio_DtmfDetectorHandlerRef_t le_audio_AddDtmfDetectorHandler (le_audio_StreamRef_t streamRef, le_audio_DtmfDetectorHandlerFunc_t handlerPtr, void *contextPtr)
 
void le_audio_RemoveDtmfDetectorHandler (le_audio_DtmfDetectorHandlerRef_t handlerRef)
 
le_result_t le_audio_EnableNoiseSuppressor (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_DisableNoiseSuppressor (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_EnableEchoCanceller (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_DisableEchoCanceller (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_IsNoiseSuppressorEnabled (le_audio_StreamRef_t streamRef, bool *statusPtr)
 
le_result_t le_audio_IsEchoCancellerEnabled (le_audio_StreamRef_t streamRef, bool *statusPtr)
 
le_result_t le_audio_EnableFirFilter (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_DisableFirFilter (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_EnableIirFilter (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_DisableIirFilter (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_EnableAutomaticGainControl (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_DisableAutomaticGainControl (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_SetProfile (uint32_t profile)
 
le_result_t le_audio_GetProfile (uint32_t *profilePtr)
 
le_result_t le_audio_SetPcmSamplingRate (uint32_t rate)
 
le_result_t le_audio_SetPcmSamplingResolution (uint32_t bitsPerSample)
 
le_result_t le_audio_SetPcmCompanding (le_audio_Companding_t companding)
 
uint32_t le_audio_GetPcmSamplingRate (void)
 
uint32_t le_audio_GetPcmSamplingResolution (void)
 
le_audio_Companding_t le_audio_GetPcmCompanding (void)
 
uint32_t le_audio_GetDefaultPcmTimeSlot (void)
 
le_audio_I2SChannel_t le_audio_GetDefaultI2sMode (void)
 
le_result_t le_audio_PlayFile (le_audio_StreamRef_t streamRef, int fd)
 
le_result_t le_audio_PlaySamples (le_audio_StreamRef_t streamRef, int fd)
 
le_result_t le_audio_RecordFile (le_audio_StreamRef_t streamRef, int fd)
 
le_result_t le_audio_GetSamples (le_audio_StreamRef_t streamRef, int fd)
 
le_result_t le_audio_Stop (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_Pause (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_Flush (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_Resume (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_SetSamplePcmChannelNumber (le_audio_StreamRef_t streamRef, uint32_t nbChannel)
 
le_result_t le_audio_GetSamplePcmChannelNumber (le_audio_StreamRef_t streamRef, uint32_t *nbChannelPtr)
 
le_result_t le_audio_SetSamplePcmSamplingRate (le_audio_StreamRef_t streamRef, uint32_t rate)
 
le_result_t le_audio_GetSamplePcmSamplingRate (le_audio_StreamRef_t streamRef, uint32_t *ratePtr)
 
le_result_t le_audio_SetSamplePcmSamplingResolution (le_audio_StreamRef_t streamRef, uint32_t samplingRes)
 
le_result_t le_audio_GetSamplePcmSamplingResolution (le_audio_StreamRef_t streamRef, uint32_t *samplingResPtr)
 
le_result_t le_audio_PlayDtmf (le_audio_StreamRef_t streamRef, const char *LE_NONNULL dtmf, uint32_t duration, uint32_t pause)
 
le_result_t le_audio_PlaySignallingDtmf (const char *LE_NONNULL dtmf, uint32_t duration, uint32_t pause)
 
le_result_t le_audio_SetEncodingFormat (le_audio_StreamRef_t streamRef, le_audio_Format_t format)
 
le_result_t le_audio_GetEncodingFormat (le_audio_StreamRef_t streamRef, le_audio_Format_t *formatPtr)
 
le_result_t le_audio_SetSampleAmrMode (le_audio_StreamRef_t streamRef, le_audio_AmrMode_t mode)
 
le_result_t le_audio_GetSampleAmrMode (le_audio_StreamRef_t streamRef, le_audio_AmrMode_t *modePtr)
 
le_result_t le_audio_SetSampleAmrDtx (le_audio_StreamRef_t streamRef, bool dtx)
 
le_result_t le_audio_GetSampleAmrDtx (le_audio_StreamRef_t streamRef, bool *dtxPtr)
 
le_result_t le_audio_SetPlatformSpecificGain (const char *LE_NONNULL gainName, int32_t gain)
 
le_result_t le_audio_GetPlatformSpecificGain (const char *LE_NONNULL gainName, int32_t *gainPtr)
 
le_result_t le_audio_MuteCallWaitingTone (void)
 
le_result_t le_audio_UnmuteCallWaitingTone (void)
 

Detailed Description

Legato Audio include file.

Typedef Documentation

◆ le_audio_DisconnectHandler_t

typedef void(* le_audio_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

Function Documentation

◆ le_audio_AddDtmfDetectorHandler()

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

Parameters
[in]streamRefAudio stream reference.
[in]handlerPtr
[in]contextPtr

◆ le_audio_AddMediaHandler()

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.

Parameters
[in]streamRefThe audio stream reference.
[in]handlerPtr
[in]contextPtr

◆ le_audio_Close()

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.

Note
If the caller is passing a bad reference into this function, it is a fatal error, the function will not return.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_Connect()

le_result_t le_audio_Connect ( le_audio_ConnectorRef_t  connectorRef,
le_audio_StreamRef_t  streamRef 
)

Connect an audio stream to the connector reference.

Returns
LE_BUSY There are insufficient DSP resources available.
LE_UNAVAILABLE The audio service initialization failed.
LE_BAD_PARAMETER The connector and/or the audio stream references are invalid.
LE_FAULT On any other failure.
LE_OK The function succeeded.
Note
If the caller is passing a bad reference into this function, it is a fatal error, the function will not return.
Parameters
[in]connectorRefConnector reference.
[in]streamRefAudio stream reference.

◆ le_audio_ConnectService()

void le_audio_ConnectService ( void  )

Connect the current client thread to the service providing this API. Block until the service is available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client-specific Functions.

This function is created automatically.

◆ le_audio_CreateConnector()

le_audio_ConnectorRef_t le_audio_CreateConnector ( void  )

Create an audio connector reference.

Returns
Reference to the audio connector, NULL if the function fails.

◆ le_audio_DeleteConnector()

void le_audio_DeleteConnector ( le_audio_ConnectorRef_t  connectorRef)

Delete an audio connector reference.

Note
If the caller is passing a bad reference into this function, it is a fatal error, the function will not return.
Parameters
[in]connectorRefConnector reference.

◆ le_audio_DisableAutomaticGainControl()

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.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Note
The process exits, if an invalid audio stream reference is given.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_DisableEchoCanceller()

le_result_t le_audio_DisableEchoCanceller ( le_audio_StreamRef_t  streamRef)

This function must be called to disable the Echo Canceller.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Note
The process exits, if an invalid audio stream reference is given.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_DisableFirFilter()

le_result_t le_audio_DisableFirFilter ( le_audio_StreamRef_t  streamRef)

This function must be called to disable the FIR (Finite Impulse Response) filter.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Note
The process exits, if an invalid audio stream reference is given.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_DisableIirFilter()

le_result_t le_audio_DisableIirFilter ( le_audio_StreamRef_t  streamRef)

This function must be called to disable the IIR (Infinite Impulse Response) filter.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Note
The process exits, if an invalid audio stream reference is given.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_DisableNoiseSuppressor()

le_result_t le_audio_DisableNoiseSuppressor ( le_audio_StreamRef_t  streamRef)

This function must be called to disable the Noise Suppressor.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Note
The process exits, if an invalid audio stream reference is given.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_Disconnect()

void le_audio_Disconnect ( le_audio_ConnectorRef_t  connectorRef,
le_audio_StreamRef_t  streamRef 
)

Disconnect an audio stream from the connector reference.

Note
If the caller is passing a bad reference into this function, it is a fatal error, the function will not return.
Parameters
[in]connectorRefConnector reference.
[in]streamRefAudio stream reference.

◆ le_audio_DisconnectService()

void le_audio_DisconnectService ( void  )

Disconnect the current client thread from the service providing this API.

Normally, this function doesn't need to be called. After this function is called, there's no longer a connection to the service, and the functions in this API can't be used. For details, see Client-specific Functions.

This function is created automatically.

◆ le_audio_EnableAutomaticGainControl()

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.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Note
The process exits, if an invalid audio stream reference is given.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_EnableEchoCanceller()

le_result_t le_audio_EnableEchoCanceller ( le_audio_StreamRef_t  streamRef)

This function must be called to enable the Echo Canceller.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Note
The process exits, if an invalid audio stream reference is given.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_EnableFirFilter()

le_result_t le_audio_EnableFirFilter ( le_audio_StreamRef_t  streamRef)

This function must be called to enable the FIR (Finite Impulse Response) filter.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Note
The process exits, if an invalid audio stream reference is given.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_EnableIirFilter()

le_result_t le_audio_EnableIirFilter ( le_audio_StreamRef_t  streamRef)

This function must be called to enable the IIR (Infinite Impulse Response) filter.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Note
The process exits, if an invalid audio stream reference is given.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_EnableNoiseSuppressor()

le_result_t le_audio_EnableNoiseSuppressor ( le_audio_StreamRef_t  streamRef)

This function must be called to enable the Noise Suppressor.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Note
The process exits, if an invalid audio stream reference is given.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_Flush()

le_result_t le_audio_Flush ( le_audio_StreamRef_t  streamRef)

Flush the remaining audio samples.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_GetDefaultI2sMode()

le_audio_I2SChannel_t le_audio_GetDefaultI2sMode ( void  )

Get the default I2S channel mode used on the current platform.

Returns
the I2S channel mode.

◆ le_audio_GetDefaultPcmTimeSlot()

uint32_t le_audio_GetDefaultPcmTimeSlot ( void  )

Get the default PCM time slot used on the current platform.

Returns
the time slot number.

◆ le_audio_GetEncodingFormat()

le_result_t le_audio_GetEncodingFormat ( le_audio_StreamRef_t  streamRef,
le_audio_Format_t *  formatPtr 
)

Get the encoding format of a recorder stream.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Note
A client calling this function with either an invalid streamRef or null out pointer parameter will be killed and the function will not return.
Parameters
[in]streamRefAudio stream reference.
[out]formatPtrEncoding format.

◆ le_audio_GetGain()

le_result_t le_audio_GetGain ( le_audio_StreamRef_t  streamRef,
int32_t *  gainPtr 
)

Get the Gain value of an input or output stream.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK The function succeeded.
Note
If the caller is passing a bad reference into this function, it is a fatal error, the function will not return.
Parameters
[in]streamRefAudio stream reference.
[out]gainPtrGain value (specific to the platform)

◆ le_audio_GetPcmCompanding()

le_audio_Companding_t le_audio_GetPcmCompanding ( void  )

Retrieve the PCM Companding.

Returns
The PCM companding.

◆ le_audio_GetPcmSamplingRate()

uint32_t le_audio_GetPcmSamplingRate ( void  )

Retrieve the PCM Sampling Rate.

Returns
The sampling rate in Hz.

◆ le_audio_GetPcmSamplingResolution()

uint32_t le_audio_GetPcmSamplingResolution ( void  )

Retrieve the PCM Sampling Resolution.

Returns
The sampling resolution (bits/sample).

◆ le_audio_GetPlatformSpecificGain()

le_result_t le_audio_GetPlatformSpecificGain ( const char *LE_NONNULL  gainName,
int32_t *  gainPtr 
)

Get the value of a platform specific gain in the audio subsystem.

Returns
LE_BAD_PARAMETER The pointer to the name of the platform specific gain is invalid.
LE_NOT_FOUND The specified gain's name is not recognized in your audio subsystem.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK The function succeeded.
Note
If the caller is passing a bad reference into this function, it is a fatal error, the function will not return.
Warning
Ensure to check the names of supported gains for your specific platform.
Parameters
[in]gainNameName of the platform specific gain.
[out]gainPtrThe gain value (specific to the platform)

◆ le_audio_GetProfile()

le_result_t le_audio_GetProfile ( uint32_t *  profilePtr)

This function must be called to get the audio profile in use.

Returns
LE_UNAVAILABLE On audio service initialization failure.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Parameters
[out]profilePtrAudio profile.

◆ le_audio_GetSampleAmrDtx()

le_result_t le_audio_GetSampleAmrDtx ( le_audio_StreamRef_t  streamRef,
bool *  dtxPtr 
)

Get the AMR discontinuous transmission (DTX) value.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Note
If the caller is passing a bad reference into this function, it is a fatal error, the function will not return.
Parameters
[in]streamRefAudio stream reference.
[out]dtxPtrDTX.

◆ le_audio_GetSampleAmrMode()

le_result_t le_audio_GetSampleAmrMode ( le_audio_StreamRef_t  streamRef,
le_audio_AmrMode_t *  modePtr 
)

Get the AMR mode for AMR encoder.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Note
A client calling this function with a null out pointer parameter will be killed and the function will not return.
Parameters
[in]streamRefAudio stream reference.
[out]modePtrAMR mode.

◆ le_audio_GetSamplePcmChannelNumber()

le_result_t le_audio_GetSamplePcmChannelNumber ( le_audio_StreamRef_t  streamRef,
uint32_t *  nbChannelPtr 
)

Get the channel number of a PCM sample.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Parameters
[in]streamRefAudio stream reference.
[out]nbChannelPtrChannel Number

◆ le_audio_GetSamplePcmSamplingRate()

le_result_t le_audio_GetSamplePcmSamplingRate ( le_audio_StreamRef_t  streamRef,
uint32_t *  ratePtr 
)

Get the PCM sampling rate of a PCM sample.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Parameters
[in]streamRefAudio stream reference.
[out]ratePtrPCM sampling Rate.

◆ le_audio_GetSamplePcmSamplingResolution()

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.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Parameters
[in]streamRefAudio stream reference.
[out]samplingResPtrSampling resolution (in bits per sample).

◆ le_audio_GetSamples()

le_result_t le_audio_GetSamples ( le_audio_StreamRef_t  streamRef,
int  fd 
)

Get samples from a recorder stream.

Returns
LE_FAULT Function failed.
LE_BUSY Recorder interface is already active.
LE_OK Function succeeded.
Note
The fd is closed by the API. To use again the same pipe, the fd parameter can be set to LE_AUDIO_NO_FD: in this case, the previous file descriptor is re-used. If the fd as to be kept on its side, the application should duplicate the fd (e.g., using dup() ) before calling the API.
When using this function recording must be stopped by calling le_audio_Stop().
Parameters
[in]streamRefAudio stream reference.
[in]fdFile descriptor.

◆ le_audio_IsEchoCancellerEnabled()

le_result_t le_audio_IsEchoCancellerEnabled ( le_audio_StreamRef_t  streamRef,
bool *  statusPtr 
)

This function must be called to get the status of Echo Canceller.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Note
The process exits, if an invalid audio stream reference is given.
Parameters
[in]streamRefAudio stream reference.
[out]statusPtrtrue if EC is enabled, false otherwise

◆ le_audio_IsNoiseSuppressorEnabled()

le_result_t le_audio_IsNoiseSuppressorEnabled ( le_audio_StreamRef_t  streamRef,
bool *  statusPtr 
)

This function must be called to get the status of Noise Suppressor.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Note
The process exits, if an invalid audio stream reference is given.
Parameters
[in]streamRefAudio stream reference.
[out]statusPtrtrue if NS is enabled, false otherwise

◆ le_audio_Mute()

le_result_t le_audio_Mute ( le_audio_StreamRef_t  streamRef)

Mute an audio stream.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK The function succeeded.
Note
If the caller is passing a bad reference into this function, it is a fatal error, the function will not return.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_MuteCallWaitingTone()

le_result_t le_audio_MuteCallWaitingTone ( void  )

Mute the Call Waiting Tone.

Returns
LE_UNAVAILABLE On audio service initialization failure.
LE_FAULT On any other failure.
LE_OK The function succeeded.

◆ le_audio_OpenI2sRx()

le_audio_StreamRef_t le_audio_OpenI2sRx ( le_audio_I2SChannel_t  mode)

Open the received audio stream of the I2S interface.

Returns
Reference to the input audio stream, NULL if the function fails.
Parameters
[in]modeThe channel mode.

◆ le_audio_OpenI2sTx()

le_audio_StreamRef_t le_audio_OpenI2sTx ( le_audio_I2SChannel_t  mode)

Open the transmitted audio stream of the I2S interface.

Returns
Reference to the output audio stream, NULL if the function fails.
Parameters
[in]modeThe channel mode.

◆ le_audio_OpenMic()

le_audio_StreamRef_t le_audio_OpenMic ( void  )

Audio recording/playback events. Companding. I2S channel mode. Audio format. AMR mode. Reference type for Audio Stream Reference type for Audio Connector Handler for audio stream event. Reference type used by Add/Remove functions for EVENT 'le_audio_Media' Handler for DTMF decoding. Reference type used by Add/Remove functions for EVENT 'le_audio_DtmfDetector' Open the Microphone.

Returns
Reference to the input audio stream, NULL if the function fails.

◆ le_audio_OpenModemVoiceRx()

le_audio_StreamRef_t le_audio_OpenModemVoiceRx ( void  )

Open the received audio stream of a voice call.

Returns
Reference to the input audio stream, NULL if the function fails.

◆ le_audio_OpenModemVoiceTx()

le_audio_StreamRef_t le_audio_OpenModemVoiceTx ( void  )

Open the transmitted audio stream of a voice call.

Returns
Reference to the output audio stream, NULL if the function fails.

◆ le_audio_OpenPcmRx()

le_audio_StreamRef_t le_audio_OpenPcmRx ( uint32_t  timeslot)

Open the received audio stream of the PCM interface.

Returns
Reference to the input audio stream, NULL if the function fails.
Parameters
[in]timeslotThe time slot number.

◆ le_audio_OpenPcmTx()

le_audio_StreamRef_t le_audio_OpenPcmTx ( uint32_t  timeslot)

Open the transmitted audio stream of the PCM interface.

Returns
Reference to the output audio stream, NULL if the function fails.
Parameters
[in]timeslotThe time slot number.

◆ le_audio_OpenPlayer()

le_audio_StreamRef_t le_audio_OpenPlayer ( void  )

Open the audio stream for playback.

Returns
Reference to the audio stream, NULL if the function fails.

◆ le_audio_OpenRecorder()

le_audio_StreamRef_t le_audio_OpenRecorder ( void  )

Open the audio stream for recording.

Returns
Reference to the audio stream, NULL if the function fails.

◆ le_audio_OpenSpeaker()

le_audio_StreamRef_t le_audio_OpenSpeaker ( void  )

Open the Speaker-phone.

Returns
Reference to the output audio stream, NULL if the function fails.

◆ le_audio_OpenUsbRx()

le_audio_StreamRef_t le_audio_OpenUsbRx ( void  )

Open the received audio stream of an USB audio class.

Returns
Reference to the input audio stream, NULL if the function fails.

◆ le_audio_OpenUsbTx()

le_audio_StreamRef_t le_audio_OpenUsbTx ( void  )

Open the transmitted audio stream of an USB audio class.

Returns
Reference to the output audio stream, NULL if the function fails.

◆ le_audio_Pause()

le_result_t le_audio_Pause ( le_audio_StreamRef_t  streamRef)

Pause the file playback/recording.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_PlayDtmf()

le_result_t le_audio_PlayDtmf ( le_audio_StreamRef_t  streamRef,
const char *LE_NONNULL  dtmf,
uint32_t  duration,
uint32_t  pause 
)

This function must be called to play a DTMF on a specific audio stream.

Returns
LE_FORMAT_ERROR The DTMF characters are invalid.
LE_BUSY A DTMF playback is already in progress on the playback stream.
LE_FAULT Function failed to play the DTMFs.
LE_OK Function succeeded.
Note
If the DTMF string is too long (max DTMF_MAX_LEN characters), it is a fatal error, the function will not return.
The process exits, if an invalid audio stream reference is given.
Parameters
[in]streamRefAudio stream reference.
[in]dtmfDTMFs to play.
[in]durationDTMF duration in milliseconds.
[in]pausePause duration between tones in milliseconds.

◆ le_audio_PlayFile()

le_result_t le_audio_PlayFile ( le_audio_StreamRef_t  streamRef,
int  fd 
)

Play a file on a playback stream.

Returns
LE_FAULT Function failed.
LE_BAD_PARAMETER Audio stream reference is invalid.
LE_BUSY Player interface is already active.
LE_OK Function succeeded.
Note
  • The fd is closed by the IPC API. To play again the same file, the fd parameter can be set to LE_AUDIO_NO_FD: in this case, the previous file descriptor is re-used. If the fd as to be kept on its side, the application should duplicate the fd (e.g., using dup() ) before calling the API. In that case, the old and new file descriptors refer to the same open file description and thus share file offset. So, once a playback has reached the end of file, the application must reset the file offset by using lseek on the duplicated descriptor to start the playback from the beginning.
  • Calling le_audio_PlayFile(<..>, LE_AUDIO_NO_FD) will rewind the audio file to the beginning when a playback is already in progress.
Parameters
[in]streamRefAudio stream reference.
[in]fdFile descriptor.

◆ le_audio_PlaySamples()

le_result_t le_audio_PlaySamples ( le_audio_StreamRef_t  streamRef,
int  fd 
)

Initiate a playback sending samples over a pipe.

Returns
LE_FAULT Function failed.
LE_BUSY Player interface is already active.
LE_OK Function succeeded.
Note
The fd is closed by the IPC API. To use again the same pipe, the fd parameter can be set to LE_AUDIO_NO_FD: in this case, the previous file descriptor is re-used. If the fd as to be kept on its side, the application should duplicate the fd (e.g., using dup() ) before calling the API.
Playback initiated with this function must be stopped by calling le_audio_Stop().
Parameters
[in]streamRefAudio stream reference.
[in]fdFile descriptor.

◆ le_audio_PlaySignallingDtmf()

le_result_t le_audio_PlaySignallingDtmf ( const char *LE_NONNULL  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.

Returns
LE_FORMAT_ERROR The DTMF characters are invalid.
LE_BUSY A DTMF playback is in progress.
LE_FAULT Function failed.
LE_OK Function succeeded.
Note
If the DTMF string is too long (max DTMF_MAX_LEN characters), it is a fatal error, the function will not return.
Parameters
[in]dtmfDTMFs to play.
[in]durationDTMF duration in milliseconds.
[in]pausePause duration between tones in milliseconds.

◆ le_audio_RecordFile()

le_result_t le_audio_RecordFile ( le_audio_StreamRef_t  streamRef,
int  fd 
)

Record a file on a recorder stream.

Returns
LE_FAULT Function failed.
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_BUSY Recorder interface is already active.
LE_OK Function succeeded.
Note
the fd is closed by the API. To record again the same file, the fd parameter can be set to LE_AUDIO_NO_FD: in this case, the previous file descriptor is re-used. If the fd as to be kept on its side, the application should duplicate the fd (e.g., using dup() ) before calling the API.
Parameters
[in]streamRefAudio stream reference.
[in]fdFile descriptor.

◆ le_audio_RemoveDtmfDetectorHandler()

void le_audio_RemoveDtmfDetectorHandler ( le_audio_DtmfDetectorHandlerRef_t  handlerRef)

Remove handler function for EVENT 'le_audio_DtmfDetector'

Parameters
[in]handlerRef

◆ le_audio_RemoveMediaHandler()

void le_audio_RemoveMediaHandler ( le_audio_MediaHandlerRef_t  handlerRef)

Remove handler function for EVENT 'le_audio_Media'

Parameters
[in]handlerRef

◆ le_audio_Resume()

le_result_t le_audio_Resume ( le_audio_StreamRef_t  streamRef)

Resume a file playback/recording (need to be in pause state).

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_SetEncodingFormat()

le_result_t le_audio_SetEncodingFormat ( le_audio_StreamRef_t  streamRef,
le_audio_Format_t  format 
)

Set the encoding format of a recorder stream.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Parameters
[in]streamRefAudio stream reference.
[in]formatEncoding format.

◆ le_audio_SetGain()

le_result_t le_audio_SetGain ( le_audio_StreamRef_t  streamRef,
int32_t  gain 
)

Set the Gain value of an input or output stream.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_OUT_OF_RANGE The gain value is out of range.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK The function succeeded.
Note
If the caller is passing a bad reference into this function, it is a fatal error, the function will not return.
Parameters
[in]streamRefAudio stream reference.
[in]gainGain value (specific to the platform)

◆ le_audio_SetPcmCompanding()

le_result_t le_audio_SetPcmCompanding ( le_audio_Companding_t  companding)

Configure the PCM Companding.

Returns
LE_FAULT Function failed.
LE_OUT_OF_RANGE Your platform does not support the setting's value.
LE_BUSY PCM interface is already active.
LE_OK Function succeeded.
Parameters
[in]compandingCompanding.

◆ le_audio_SetPcmSamplingRate()

le_result_t le_audio_SetPcmSamplingRate ( uint32_t  rate)

Configure the PCM Sampling Rate.

Returns
LE_FAULT Function failed.
LE_OUT_OF_RANGE Your platform does not support the setting's value.
LE_BUSY PCM interface is already active.
LE_OK Function succeeded.
Parameters
[in]rateSampling rate in Hz.

◆ le_audio_SetPcmSamplingResolution()

le_result_t le_audio_SetPcmSamplingResolution ( uint32_t  bitsPerSample)

Configure the PCM Sampling Resolution.

Returns
LE_FAULT Function failed.
LE_OUT_OF_RANGE Your platform does not support the setting's value.
LE_BUSY PCM interface is already active.
LE_OK Function succeeded.
Parameters
[in]bitsPerSampleSampling resolution (bits/sample).

◆ le_audio_SetPlatformSpecificGain()

le_result_t le_audio_SetPlatformSpecificGain ( const char *LE_NONNULL  gainName,
int32_t  gain 
)

Set the value of a platform specific gain in the audio subsystem.

Returns
LE_BAD_PARAMETER The pointer to the name of the platform specific gain is invalid.
LE_NOT_FOUND The specified gain's name is not recognized in your audio subsystem.
LE_OUT_OF_RANGE The gain parameter is out of range.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK The function succeeded.
Note
If the caller is passing a bad reference into this function, it is a fatal error, the function will not return.
Warning
Ensure to check the names of supported gains for your specific platform.
Parameters
[in]gainNameName of the platform specific gain.
[in]gainThe gain value (specific to the platform)

◆ le_audio_SetProfile()

le_result_t le_audio_SetProfile ( uint32_t  profile)

This function must be called to set the audio profile.

Returns
LE_UNAVAILABLE On audio service initialization failure.
LE_FAULT On any other failure.
LE_OK Function succeeded.
Parameters
[in]profileAudio profile.

◆ le_audio_SetSampleAmrDtx()

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.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Note
If the caller is passing a bad reference into this function, it is a fatal error, the function will not return.
Parameters
[in]streamRefAudio stream reference.
[in]dtxDTX.

◆ le_audio_SetSampleAmrMode()

le_result_t le_audio_SetSampleAmrMode ( le_audio_StreamRef_t  streamRef,
le_audio_AmrMode_t  mode 
)

Set the AMR mode for AMR encoder.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Parameters
[in]streamRefAudio stream reference.
[in]modeAMR mode.

◆ le_audio_SetSamplePcmChannelNumber()

le_result_t le_audio_SetSamplePcmChannelNumber ( le_audio_StreamRef_t  streamRef,
uint32_t  nbChannel 
)

Set the channel number of a PCM sample.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Parameters
[in]streamRefAudio stream reference.
[in]nbChannelChannel Number

◆ le_audio_SetSamplePcmSamplingRate()

le_result_t le_audio_SetSamplePcmSamplingRate ( le_audio_StreamRef_t  streamRef,
uint32_t  rate 
)

Set the PCM sampling rate of a PCM sample.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Parameters
[in]streamRefAudio stream reference.
[in]ratePCM sampling Rate.

◆ le_audio_SetSamplePcmSamplingResolution()

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.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Parameters
[in]streamRefAudio stream reference.
[in]samplingResSampling resolution (in bits per sample).

◆ le_audio_SetServerDisconnectHandler()

LE_FULL_API void le_audio_SetServerDisconnectHandler ( le_audio_DisconnectHandler_t  disconnectHandler,
void *  contextPtr 
)

Set handler called when server disconnection is detected.

When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants to continue without exiting, it should call longjmp() from inside the handler.

◆ le_audio_Stop()

le_result_t le_audio_Stop ( le_audio_StreamRef_t  streamRef)

Stop the file playback/recording.

Returns
LE_FAULT Function failed.
LE_OK Function succeeded.
Note
The used file descriptor is not deallocated, but is is rewound to the beginning.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_TryConnectService()

le_result_t le_audio_TryConnectService ( void  )

Try to connect the current client thread to the service providing this API. Return with an error if the service is not available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client-specific Functions.

This function is created automatically.

Returns
  • LE_OK if the client connected successfully to the service.
  • LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
  • LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
  • LE_COMM_ERROR if the Service Directory cannot be reached.

◆ le_audio_Unmute()

le_result_t le_audio_Unmute ( le_audio_StreamRef_t  streamRef)

Unmute an audio stream.

Returns
LE_BAD_PARAMETER The audio stream reference is invalid.
LE_UNAVAILABLE The audio service initialization failed.
LE_FAULT On any other failure.
LE_OK The function succeeded.
Note
If the caller is passing a bad reference into this function, it is a fatal error, the function will not return.
Parameters
[in]streamRefAudio stream reference.

◆ le_audio_UnmuteCallWaitingTone()

le_result_t le_audio_UnmuteCallWaitingTone ( void  )

Unmute the Call Waiting Tone.

Returns
LE_UNAVAILABLE On audio service initialization failure.
LE_FAULT On any other failure.
LE_OK The function succeeded.