le_audio API Reference
Files | |
file | le_audio_common.h |
file | le_audio_interface.h |
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) |
typedef void(* | le_audio_DisconnectHandler_t) (void *) |
Detailed Description
Macro Definition Documentation
◆ LE_AUDIO_DTMF_MAX_BYTES
#define LE_AUDIO_DTMF_MAX_BYTES 101 |
Maximum DTMF string length. One extra byte is added for the null character.
◆ LE_AUDIO_DTMF_MAX_LEN
#define LE_AUDIO_DTMF_MAX_LEN 100 |
Maximum DTMF string length.
◆ LE_AUDIO_GAIN_NAME_MAX_BYTES
#define LE_AUDIO_GAIN_NAME_MAX_BYTES 101 |
Maximum gain name string length. One extra byte is added for the null character.
◆ LE_AUDIO_GAIN_NAME_MAX_LEN
#define LE_AUDIO_GAIN_NAME_MAX_LEN 100 |
Maximum gain name string length.
◆ LE_AUDIO_NO_FD
#define LE_AUDIO_NO_FD -1 |
No file descriptor define
Typedef Documentation
◆ le_audio_ConnectorRef_t
typedef struct le_audio_Connector* le_audio_ConnectorRef_t |
Reference type for Audio Connector
◆ le_audio_DisconnectHandler_t
typedef void(* le_audio_DisconnectHandler_t) (void *) |
Type for handler called when a server disconnects.
◆ le_audio_DtmfDetectorHandlerFunc_t
typedef void(* le_audio_DtmfDetectorHandlerFunc_t) (le_audio_StreamRef_t streamRef, char dtmf, void *contextPtr) |
Handler for DTMF decoding.
◆ le_audio_DtmfDetectorHandlerRef_t
typedef struct le_audio_DtmfDetectorHandler* le_audio_DtmfDetectorHandlerRef_t |
Reference type used by Add/Remove functions for EVENT 'le_audio_DtmfDetector'
◆ le_audio_MediaHandlerFunc_t
typedef void(* le_audio_MediaHandlerFunc_t) (le_audio_StreamRef_t streamRef, le_audio_MediaEvent_t event, void *contextPtr) |
Handler for audio stream event.
◆ le_audio_MediaHandlerRef_t
typedef struct le_audio_MediaHandler* le_audio_MediaHandlerRef_t |
Reference type used by Add/Remove functions for EVENT 'le_audio_Media'
◆ le_audio_StreamRef_t
typedef struct le_audio_Stream* le_audio_StreamRef_t |
Reference type for Audio Stream
Enumeration Type Documentation
◆ le_audio_AmrMode_t
enum le_audio_AmrMode_t |
AMR mode.
◆ le_audio_Companding_t
◆ le_audio_Format_t
enum le_audio_Format_t |
◆ le_audio_I2SChannel_t
◆ le_audio_MediaEvent_t
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] streamRef Audio 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] streamRef The 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] streamRef Audio 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] connectorRef Connector reference. [in] streamRef Audio 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] connectorRef Connector 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] streamRef Audio 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] streamRef Audio 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] streamRef Audio 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] streamRef Audio 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] streamRef Audio 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] connectorRef Connector reference. [in] streamRef Audio 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] streamRef Audio 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] streamRef Audio 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] streamRef Audio 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] streamRef Audio 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] streamRef Audio 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] streamRef Audio 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] streamRef Audio stream reference. [out] formatPtr Encoding 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] streamRef Audio stream reference. [out] gainPtr Gain 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] gainName Name of the platform specific gain. [out] gainPtr The 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] profilePtr Audio 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] streamRef Audio stream reference. [out] dtxPtr DTX.
◆ 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] streamRef Audio stream reference. [out] modePtr AMR 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] streamRef Audio stream reference. [out] nbChannelPtr Channel 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] streamRef Audio stream reference. [out] ratePtr PCM 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] streamRef Audio stream reference. [out] samplingResPtr Sampling 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] streamRef Audio stream reference. [in] fd File 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] streamRef Audio stream reference. [out] statusPtr true 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] streamRef Audio stream reference. [out] statusPtr true 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] streamRef Audio 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] mode The 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] mode The 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] timeslot The 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] timeslot The 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] streamRef Audio 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.
- If the DTMF duration or pause is more than 5000ms, it is a fatal error, the function will not return.
- The process exits, if an invalid audio stream reference is given.
- Parameters
-
[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_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] streamRef Audio stream reference. [in] fd File 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] streamRef Audio stream reference. [in] fd File 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] dtmf DTMFs to play. [in] duration DTMF duration in milliseconds. [in] pause Pause 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] streamRef Audio stream reference. [in] fd File 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] streamRef Audio 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] streamRef Audio stream reference. [in] format Encoding 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] streamRef Audio stream reference. [in] gain Gain 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] companding Companding.
◆ 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] rate Sampling 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] bitsPerSample Sampling 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] gainName Name of the platform specific gain. [in] gain The 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] profile Audio 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] streamRef Audio stream reference. [in] dtx DTX.
◆ 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] streamRef Audio stream reference. [in] mode AMR 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] streamRef Audio stream reference. [in] nbChannel Channel 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] streamRef Audio stream reference. [in] rate PCM 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] streamRef Audio stream reference. [in] samplingRes Sampling 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] streamRef Audio 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] streamRef Audio 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.