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 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)
 

Enumerations

enum  le_audio_MediaEvent_t { LE_AUDIO_MEDIA_ENDED = 0, LE_AUDIO_MEDIA_NO_MORE_SAMPLES = 1, LE_AUDIO_MEDIA_ERROR = 2, LE_AUDIO_MEDIA_MAX = 3 }
 
enum  le_audio_Companding_t { LE_AUDIO_COMPANDING_ALAW = 0, LE_AUDIO_COMPANDING_ULAW = 1, LE_AUDIO_COMPANDING_NONE = 2 }
 
enum  le_audio_I2SChannel_t {
  LE_AUDIO_I2S_LEFT = 0, LE_AUDIO_I2S_RIGHT = 1, LE_AUDIO_I2S_MONO = 2, LE_AUDIO_I2S_STEREO = 3,
  LE_AUDIO_I2S_REVERSE = 4
}
 
enum  le_audio_Format_t { LE_AUDIO_WAVE = 0, LE_AUDIO_AMR = 1, LE_AUDIO_FORMAT_MAX = 2 }
 
enum  le_audio_AmrMode_t {
  LE_AUDIO_AMR_NONE = 0, LE_AUDIO_AMR_NB_4_75_KBPS = 1, LE_AUDIO_AMR_NB_5_15_KBPS = 2, LE_AUDIO_AMR_NB_5_9_KBPS = 3,
  LE_AUDIO_AMR_NB_6_7_KBPS = 4, LE_AUDIO_AMR_NB_7_4_KBPS = 5, LE_AUDIO_AMR_NB_7_95_KBPS = 6, LE_AUDIO_AMR_NB_10_2_KBPS = 7,
  LE_AUDIO_AMR_NB_12_2_KBPS = 8, LE_AUDIO_AMR_WB_6_6_KBPS = 9, LE_AUDIO_AMR_WB_8_85_KBPS = 10, LE_AUDIO_AMR_WB_12_65_KBPS = 11,
  LE_AUDIO_AMR_WB_14_25_KBPS = 12, LE_AUDIO_AMR_WB_15_85_KBPS = 13, LE_AUDIO_AMR_WB_18_25_KBPS = 14, LE_AUDIO_AMR_WB_19_85_KBPS = 15,
  LE_AUDIO_AMR_WB_23_05_KBPS = 16, LE_AUDIO_AMR_WB_23_85_KBPS = 17
}
 

Functions

void le_audio_ConnectService (void)
 
le_result_t le_audio_TryConnectService (void)
 
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 addHandlerRef)
 
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 addHandlerRef)
 
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_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 *dtmf, uint32_t duration, uint32_t pause)
 
le_result_t le_audio_PlaySignallingDtmf (const char *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 *gainName, int32_t gain)
 
le_result_t le_audio_GetPlatformSpecificGain (const char *gainName, int32_t *gainPtr)
 
le_result_t le_audio_MuteCallWaitingTone (void)
 
le_result_t le_audio_UnmuteCallWaitingTone (void)
 

Detailed Description

Legato Audio include file.

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_DtmfDetectorHandlerFunc_t) (le_audio_StreamRef_t streamRef, char dtmf, void *contextPtr)

Handler for DTMF decoding.

Parameters
streamRefAudio stream reference.
dtmfDetected DTMF.
contextPtr
typedef struct le_audio_DtmfDetectorHandler* le_audio_DtmfDetectorHandlerRef_t

Reference type used by Add/Remove functions for EVENT 'le_audio_DtmfDetector'

typedef void(* le_audio_MediaHandlerFunc_t) (le_audio_StreamRef_t streamRef, le_audio_MediaEvent_t event, void *contextPtr)

Handler for audio stream event.

Parameters
streamRefAudio stream reference.
eventEvent value.
contextPtr
typedef struct le_audio_MediaHandler* le_audio_MediaHandlerRef_t

Reference type used by Add/Remove functions for EVENT 'le_audio_Media'

typedef struct le_audio_Stream* le_audio_StreamRef_t

Reference type for Audio Stream

Enumeration Type Documentation

AMR mode.

Enumerator
LE_AUDIO_AMR_NONE 

Not set.

LE_AUDIO_AMR_NB_4_75_KBPS 

AMR Narrowband in 4.75kbps.

LE_AUDIO_AMR_NB_5_15_KBPS 

AMR Narrowband in 5.15kbps.

LE_AUDIO_AMR_NB_5_9_KBPS 

AMR Narrowband in 5.9kbps.

LE_AUDIO_AMR_NB_6_7_KBPS 

AMR Narrowband in 6.7kbps.

LE_AUDIO_AMR_NB_7_4_KBPS 

AMR Narrowband in 7.4kbps (default value)

LE_AUDIO_AMR_NB_7_95_KBPS 

AMR Narrowband in 7.95kbps.

LE_AUDIO_AMR_NB_10_2_KBPS 

AMR Narrowband in 10.3kbps.

LE_AUDIO_AMR_NB_12_2_KBPS 

AMR Narrowband in 12.2kbps.

LE_AUDIO_AMR_WB_6_6_KBPS 

AMR Wideband in 6.6kbps.

LE_AUDIO_AMR_WB_8_85_KBPS 

AMR Wideband in 8.85kbps.

LE_AUDIO_AMR_WB_12_65_KBPS 

AMR Wideband in 12.65kbps.

LE_AUDIO_AMR_WB_14_25_KBPS 

AMR Wideband in 14.25kbps.

LE_AUDIO_AMR_WB_15_85_KBPS 

AMR Wideband in 15.85kbps.

LE_AUDIO_AMR_WB_18_25_KBPS 

AMR Wideband in 18.25kbps.

LE_AUDIO_AMR_WB_19_85_KBPS 

AMR Wideband in 19.85kbps.

LE_AUDIO_AMR_WB_23_05_KBPS 

AMR Wideband in 23.05kbps.

LE_AUDIO_AMR_WB_23_85_KBPS 

AMR Wideband in 23.85kbps.

Companding.

Enumerator
LE_AUDIO_COMPANDING_ALAW 

A-law PCM (i.e. Europe and most of the rest of the world).

LE_AUDIO_COMPANDING_ULAW 

MU-law PCM (i.e. North America and Japan).

LE_AUDIO_COMPANDING_NONE 

Linear PCM.

Audio format.

Enumerator
LE_AUDIO_WAVE 

Waveform audio file.

LE_AUDIO_AMR 

Adaptive Multi Rate.

I2S channel mode.

Enumerator
LE_AUDIO_I2S_LEFT 

Left channel.

LE_AUDIO_I2S_RIGHT 

Right channel.

LE_AUDIO_I2S_MONO 

Mono mode.

LE_AUDIO_I2S_STEREO 

Stereo mode.

LE_AUDIO_I2S_REVERSE 

Reverse mode (left & right reversed).

Audio recording/playback events.

Enumerator
LE_AUDIO_MEDIA_ENDED 

Playback has reached the end of file.

LE_AUDIO_MEDIA_NO_MORE_SAMPLES 

No more audio samples to play.

LE_AUDIO_MEDIA_ERROR 

Recording/playback has encountered an error.

LE_AUDIO_MEDIA_MAX 

Enumerate max value.

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]streamRefAudio 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]streamRefThe 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]streamRefAudio 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]connectorRefConnector reference.
[in]streamRefAudio 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]connectorRefConnector 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]streamRefAudio 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]streamRefAudio 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]streamRefAudio 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]streamRefAudio 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]streamRefAudio 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]connectorRefConnector reference.
[in]streamRefAudio 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]streamRefAudio 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]streamRefAudio 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]streamRefAudio 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]streamRefAudio 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]streamRefAudio 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]streamRefAudio 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.
Parameters
[in]streamRefAudio stream reference.
[out]formatPtrEncoding 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]streamRefAudio stream reference.
[out]gainPtrGain 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 *  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]gainNameName of the platform specific gain.
[out]gainPtrThe 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]profilePtrAudio 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]streamRefAudio stream reference.
[out]dtxPtrDTX.
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.
Parameters
[in]streamRefAudio stream reference.
[out]modePtrAMR 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]streamRefAudio stream reference.
[out]nbChannelPtrChannel 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]streamRefAudio stream reference.
[out]ratePtrPCM 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]streamRefAudio stream reference.
[out]samplingResPtrSampling 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.
Parameters
[in]streamRefAudio stream reference.
[in]fdFile descriptor.
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]streamRefAudio 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]modeThe 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]modeThe 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]timeslotThe 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]timeslotThe 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]streamRefAudio stream reference.
le_result_t le_audio_PlayDtmf ( le_audio_StreamRef_t  streamRef,
const char *  dtmf,
uint32_t  duration,
uint32_t  pause 
)

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

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]streamRefAudio stream reference.
[in]dtmfDTMFs to play.
[in]durationDTMF duration in milliseconds.
[in]pausePause 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]streamRefAudio stream reference.
[in]fdFile 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.
Parameters
[in]streamRefAudio stream reference.
[in]fdFile descriptor.
le_result_t le_audio_PlaySignallingDtmf ( const char *  dtmf,
uint32_t  duration,
uint32_t  pause 
)

This function must be called to ask to the Mobile Network to generate on the remote audio party the DTMFs.

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]dtmfDTMFs to play.
[in]durationDTMF duration in milliseconds.
[in]pausePause 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]streamRefAudio stream reference.
[in]fdFile descriptor.
void le_audio_RemoveDtmfDetectorHandler ( le_audio_DtmfDetectorHandlerRef_t  addHandlerRef)

Remove handler function for EVENT 'le_audio_DtmfDetector'

Parameters
[in]addHandlerRef
void le_audio_RemoveMediaHandler ( le_audio_MediaHandlerRef_t  addHandlerRef)

Remove handler function for EVENT 'le_audio_Media'

Parameters
[in]addHandlerRef
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_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_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]streamRefAudio stream reference.
[in]gainGain 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]compandingCompanding.
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_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_result_t le_audio_SetPlatformSpecificGain ( const char *  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]gainNameName of the platform specific gain.
[in]gainThe 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]profileAudio 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]streamRefAudio stream reference.
[in]dtxDTX.
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_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_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_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_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_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]streamRefAudio 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.