le_audio_interface.h File Reference
#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 void(* | le_audio_DisconnectHandler_t) (void *) |
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) |
Detailed Description
Legato Audio include file.
Copyright (C) Sierra Wireless Inc.
Macro Definition Documentation
#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 Documentation
typedef struct le_audio_Connector* le_audio_ConnectorRef_t |
Reference type for Audio Connector
typedef void(* le_audio_DisconnectHandler_t) (void *) |
Type for handler called when a server disconnects.
typedef void(* le_audio_DtmfDetectorHandlerFunc_t) (le_audio_StreamRef_t streamRef,char dtmf,void *contextPtr) |
Handler for DTMF decoding.
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.
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
Enumeration Type Documentation
enum le_audio_AmrMode_t |
AMR mode.
enum le_audio_Format_t |
Function Documentation
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_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
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_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_FAULT Function failed.
- LE_BUSY Insufficient DSP resources available.
- LE_BAD_PARAMETER Connector and/or the audio stream references are invalid.
- 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] connectorRef Connector reference. [in] streamRef Audio stream reference.
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_ConnectorRef_t le_audio_CreateConnector | ( | void | ) |
Create an audio connector reference.
- Returns
- Reference to the audio connector, NULL if the function fails.
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_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_FAULT Function failed.
- LE_OK Function succeeded.
- Note
- The process exits, if an invalid audio stream reference is given.
- Parameters
-
[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.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Note
- The process exits, if an invalid audio stream reference is given.
- Parameters
-
[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.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Note
- The process exits, if an invalid audio stream reference is given.
- Parameters
-
[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.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Note
- The process exits, if an invalid audio stream reference is given.
- Parameters
-
[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.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Note
- The process exits, if an invalid audio stream reference is given.
- Parameters
-
[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.
- 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.
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_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_FAULT Function failed.
- LE_OK Function succeeded.
- Note
- The process exits, if an invalid audio stream reference is given.
- Parameters
-
[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.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Note
- The process exits, if an invalid audio stream reference is given.
- Parameters
-
[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.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Note
- The process exits, if an invalid audio stream reference is given.
- Parameters
-
[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.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Note
- The process exits, if an invalid audio stream reference is given.
- Parameters
-
[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.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Note
- The process exits, if an invalid audio stream reference is given.
- Parameters
-
[in] streamRef Audio stream reference.
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_I2SChannel_t le_audio_GetDefaultI2sMode | ( | void | ) |
Get the default I2S channel mode used on the current platform.
- Returns
- the I2S channel mode.
uint32_t le_audio_GetDefaultPcmTimeSlot | ( | void | ) |
Get the default PCM time slot used on the current platform.
- Returns
- the time slot number.
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_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_FAULT Function failed.
- LE_BAD_PARAMETER Audio stream reference is invalid.
- 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] gainPtr Gain value (specific to the platform)
le_audio_Companding_t le_audio_GetPcmCompanding | ( | void | ) |
Retrieve the PCM Companding.
- Returns
- The PCM companding.
uint32_t le_audio_GetPcmSamplingRate | ( | void | ) |
Retrieve the PCM Sampling Rate.
- Returns
- The sampling rate in Hz.
uint32_t le_audio_GetPcmSamplingResolution | ( | void | ) |
Retrieve the PCM Sampling Resolution.
- Returns
- The sampling resolution (bits/sample).
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_FAULT The function failed.
- LE_NOT_FOUND The specified gain's name is not recognized in your audio subsystem.
- LE_OK The function succeeded.
- 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_result_t le_audio_GetProfile | ( | uint32_t * | profilePtr | ) |
This function must be called to get the audio profile in use.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Parameters
-
[out] profilePtr Audio profile.
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.
- Parameters
-
[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.
- 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_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_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_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_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_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_FAULT Function failed.
- LE_BAD_PARAMETER If streamRef contains an invalid audioInterface.
- 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_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_FAULT Function failed.
- LE_BAD_PARAMETER If streamRef contains an invalid audioInterface.
- 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_result_t le_audio_Mute | ( | le_audio_StreamRef_t | streamRef | ) |
Mute an audio stream.
- Returns
- LE_FAULT Function failed.
- LE_BAD_PARAMETER Audio stream reference is invalid.
- 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.
le_result_t le_audio_MuteCallWaitingTone | ( | void | ) |
Mute the Call Waiting Tone.
- Returns
- LE_FAULT The function failed.
- LE_OK The function succeeded.
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_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_StreamRef_t le_audio_OpenMic | ( | void | ) |
Open the Microphone.
- Returns
- Reference to the input audio stream, NULL if the function fails.
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_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_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_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_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_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_StreamRef_t le_audio_OpenSpeaker | ( | void | ) |
Open the Speakerphone.
- Returns
- Reference to the output audio stream, NULL if the function fails.
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_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_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_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 Funtion 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] 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.
- 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_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_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 Funtion 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_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.
void le_audio_RemoveDtmfDetectorHandler | ( | le_audio_DtmfDetectorHandlerRef_t | handlerRef | ) |
Remove handler function for EVENT 'le_audio_DtmfDetector'
- Parameters
-
[in] handlerRef
void le_audio_RemoveMediaHandler | ( | le_audio_MediaHandlerRef_t | handlerRef | ) |
Remove handler function for EVENT 'le_audio_Media'
- Parameters
-
[in] handlerRef
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_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_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_FAULT Function failed.
- LE_BAD_PARAMETER Audio stream reference is invalid.
- LE_OUT_OF_RANGE Gain value is out of range
- 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] gain Gain value (specific to the platform)
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_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_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_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_FAULT The function failed.
- 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_OK The function succeeded.
- 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_result_t le_audio_SetProfile | ( | uint32_t | profile | ) |
This function must be called to set the audio profile.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Parameters
-
[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.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Parameters
-
[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.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Parameters
-
[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.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Parameters
-
[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.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Parameters
-
[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.
- Returns
- LE_FAULT Function failed.
- LE_OK Function succeeded.
- Parameters
-
[in] streamRef Audio stream reference. [in] samplingRes Sampling resolution (in bits per sample).
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_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_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_result_t le_audio_Unmute | ( | le_audio_StreamRef_t | streamRef | ) |
Unmute an audio stream.
- Returns
- LE_FAULT Function failed.
- LE_BAD_PARAMETER Audio stream reference is invalid.
- 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.
le_result_t le_audio_UnmuteCallWaitingTone | ( | void | ) |
Unmute the Call Waiting Tone.
- Returns
- LE_FAULT The function failed.
- LE_OK The function succeeded.