le_audio_interface.h
Go to the documentation of this file.
49 * An audio profile can be retrieved with le_audio_GetProfile() and set with le_audio_SetProfile().51 * Then, the following functions let you enable or disable the audio settings on the selected audio57 * - le_audio_EnableIirFilter()/ le_audio_DisableIirFilter(): downlink IIR Filter (Infinite Impulse65 * To configure the encoding format, use le_audio_GetEncodingFormat() and le_audio_SetEncodingFormat().71 * - le_audio_GetPcmSamplingResolution() and le_audio_SetPcmSamplingResolution() for bit/sample settings.73 * - le_audio_GetSamplePcmChannelNumber() and le_audio_SetSamplePcmChannelNumber() for channel numbers.102 * - le_audio_OpenModemVoiceTx(): returns an Audio Stream Reference of the digitized audio signal127 * On most platforms, it only allocates a context in memory. The audio path becomes active when the133 * Once the users get an Audio Stream reference, they can control it with the following functions:142 * @note Multimedia (playback and recording) must be controled separatly from the main audio path144 * muting/unmuting the multimedia stream, and not the other connected stream. For example, in case154 * - le_audio_SetPlatformSpecificGain(): adjust the value of a platform specific gain in the audio179 * A sample code that implements audio connectors and audio streams during voice call can be found in183 * In particular, a connector using Modem Voice Rx or Tx interfaces has to be created before dialing200 * - AMR_NB (AMR Narrowband) codec that encodes narrowband (200--3400 Hz) signals at variable bit202 * - AMR-WB (AMR Wideband) is an ITU-T standard speech codec which improved speech quality due to a227 * "I2S Rx", "Modem Voice Tx" and "Recorder" must be previously connected before recording a file.256 * - The playback/record stops playing/recording, and the read/write position indicator associated257 * with the file stream is rewound to the beginning of the file. A new file can be played/recorded259 * - le_audio_Pause(): can be called to pause a play/record. The file playing/recording is put on274 * @note The @c LE_AUDIO_MEDIA_NO_MORE_SAMPLES event indicates when all samples put into the pipe277 * A sample code that implements audio playback and capture can be found in \b audioPlaybackRec.c282 * The le_audio_PlayDtmf() function allows the application to play one or several DTMF on a playback283 * stream. The duration and the pause of the DTMFs must also be specified with the input parameters.285 * The le_audio_PlaySignallingDtmf() function allows the application to ask the Mobile Network to287 * le_audio_PlaySignallingDtmf() function may offer a better signal quality, but the the duration290 * The application must register a handler function to detect incoming DTMF characters on a specific291 * input audio stream. The le_audio_AddDtmfDetectorHandler() function installs a handler for DTMF300 * A sample code that implements DTMF playback and decoding can be found in \b audioDtmfTest.c file336 //--------------------------------------------------------------------------------------------------339 * Connect the current client thread to the service providing this API. Block until the service is342 * For each thread that wants to use this API, either ConnectService or TryConnectService must be343 * called before any other functions in this API. Normally, ConnectService is automatically called348 //--------------------------------------------------------------------------------------------------354 //--------------------------------------------------------------------------------------------------357 * Try to connect the current client thread to the service providing this API. Return with an error360 * For each thread that wants to use this API, either ConnectService or TryConnectService must be361 * called before any other functions in this API. Normally, ConnectService is automatically called368 * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.369 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).372 //--------------------------------------------------------------------------------------------------378 //--------------------------------------------------------------------------------------------------384 * longer a connection to the service, and the functions in this API can't be used. For details, see389 //--------------------------------------------------------------------------------------------------396 //--------------------------------------------------------------------------------------------------400 //--------------------------------------------------------------------------------------------------418 //--------------------------------------------------------------------------------------------------422 //--------------------------------------------------------------------------------------------------437 //--------------------------------------------------------------------------------------------------441 //--------------------------------------------------------------------------------------------------462 //--------------------------------------------------------------------------------------------------466 //--------------------------------------------------------------------------------------------------480 //--------------------------------------------------------------------------------------------------484 //--------------------------------------------------------------------------------------------------544 //--------------------------------------------------------------------------------------------------548 //--------------------------------------------------------------------------------------------------552 //--------------------------------------------------------------------------------------------------557 //--------------------------------------------------------------------------------------------------561 //--------------------------------------------------------------------------------------------------565 //--------------------------------------------------------------------------------------------------569 //--------------------------------------------------------------------------------------------------573 //--------------------------------------------------------------------------------------------------577 //--------------------------------------------------------------------------------------------------582 //--------------------------------------------------------------------------------------------------586 //--------------------------------------------------------------------------------------------------590 //--------------------------------------------------------------------------------------------------594 //--------------------------------------------------------------------------------------------------598 //--------------------------------------------------------------------------------------------------602 //--------------------------------------------------------------------------------------------------606 //--------------------------------------------------------------------------------------------------610 //--------------------------------------------------------------------------------------------------614 //--------------------------------------------------------------------------------------------------618 //--------------------------------------------------------------------------------------------------629 //--------------------------------------------------------------------------------------------------631 (638 //--------------------------------------------------------------------------------------------------649 //--------------------------------------------------------------------------------------------------651 (657 //--------------------------------------------------------------------------------------------------663 //--------------------------------------------------------------------------------------------------669 //--------------------------------------------------------------------------------------------------675 //--------------------------------------------------------------------------------------------------681 //--------------------------------------------------------------------------------------------------687 //--------------------------------------------------------------------------------------------------693 //--------------------------------------------------------------------------------------------------699 //--------------------------------------------------------------------------------------------------705 //--------------------------------------------------------------------------------------------------711 //--------------------------------------------------------------------------------------------------718 //--------------------------------------------------------------------------------------------------724 //--------------------------------------------------------------------------------------------------731 //--------------------------------------------------------------------------------------------------737 //--------------------------------------------------------------------------------------------------744 //--------------------------------------------------------------------------------------------------750 //--------------------------------------------------------------------------------------------------757 //--------------------------------------------------------------------------------------------------763 //--------------------------------------------------------------------------------------------------769 //--------------------------------------------------------------------------------------------------775 //--------------------------------------------------------------------------------------------------781 //--------------------------------------------------------------------------------------------------787 //--------------------------------------------------------------------------------------------------793 //--------------------------------------------------------------------------------------------------799 //--------------------------------------------------------------------------------------------------805 //--------------------------------------------------------------------------------------------------811 //--------------------------------------------------------------------------------------------------824 //--------------------------------------------------------------------------------------------------828 //--------------------------------------------------------------------------------------------------835 //--------------------------------------------------------------------------------------------------844 //--------------------------------------------------------------------------------------------------851 //--------------------------------------------------------------------------------------------------863 //--------------------------------------------------------------------------------------------------873 //--------------------------------------------------------------------------------------------------884 //--------------------------------------------------------------------------------------------------894 //--------------------------------------------------------------------------------------------------905 //--------------------------------------------------------------------------------------------------912 //--------------------------------------------------------------------------------------------------923 //--------------------------------------------------------------------------------------------------930 //--------------------------------------------------------------------------------------------------936 //--------------------------------------------------------------------------------------------------942 //--------------------------------------------------------------------------------------------------949 //--------------------------------------------------------------------------------------------------956 //--------------------------------------------------------------------------------------------------968 //--------------------------------------------------------------------------------------------------978 //--------------------------------------------------------------------------------------------------985 //--------------------------------------------------------------------------------------------------995 //--------------------------------------------------------------------------------------------------1001 //--------------------------------------------------------------------------------------------------1014 //--------------------------------------------------------------------------------------------------1018 //--------------------------------------------------------------------------------------------------1025 //--------------------------------------------------------------------------------------------------1034 //--------------------------------------------------------------------------------------------------1041 //--------------------------------------------------------------------------------------------------1050 //--------------------------------------------------------------------------------------------------1057 //--------------------------------------------------------------------------------------------------1066 //--------------------------------------------------------------------------------------------------1073 //--------------------------------------------------------------------------------------------------1082 //--------------------------------------------------------------------------------------------------1089 //--------------------------------------------------------------------------------------------------1099 //--------------------------------------------------------------------------------------------------1109 //--------------------------------------------------------------------------------------------------1119 //--------------------------------------------------------------------------------------------------1129 //--------------------------------------------------------------------------------------------------1138 //--------------------------------------------------------------------------------------------------1145 //--------------------------------------------------------------------------------------------------1154 //--------------------------------------------------------------------------------------------------1161 //--------------------------------------------------------------------------------------------------1170 //--------------------------------------------------------------------------------------------------1177 //--------------------------------------------------------------------------------------------------1186 //--------------------------------------------------------------------------------------------------1193 //--------------------------------------------------------------------------------------------------1195 * This function must be called to enable the automatic gain control on the selected audio stream.1202 //--------------------------------------------------------------------------------------------------1209 //--------------------------------------------------------------------------------------------------1211 * This function must be called to disable the automatic gain control on the selected audio stream.1218 //--------------------------------------------------------------------------------------------------1225 //--------------------------------------------------------------------------------------------------1233 //--------------------------------------------------------------------------------------------------1240 //--------------------------------------------------------------------------------------------------1248 //--------------------------------------------------------------------------------------------------1255 //--------------------------------------------------------------------------------------------------1264 //--------------------------------------------------------------------------------------------------1271 //--------------------------------------------------------------------------------------------------1280 //--------------------------------------------------------------------------------------------------1287 //--------------------------------------------------------------------------------------------------1296 //--------------------------------------------------------------------------------------------------1303 //--------------------------------------------------------------------------------------------------1309 //--------------------------------------------------------------------------------------------------1315 //--------------------------------------------------------------------------------------------------1321 //--------------------------------------------------------------------------------------------------1327 //--------------------------------------------------------------------------------------------------1333 //--------------------------------------------------------------------------------------------------1339 //--------------------------------------------------------------------------------------------------1345 //--------------------------------------------------------------------------------------------------1351 //--------------------------------------------------------------------------------------------------1357 //--------------------------------------------------------------------------------------------------1363 //--------------------------------------------------------------------------------------------------1378 * thus share file offset. So, once a playback has reached the end of file, the application must1387 //--------------------------------------------------------------------------------------------------1397 //--------------------------------------------------------------------------------------------------1405 * @note the fd is closed by the IPC API. To use again the same pipe, the fd parameter can be set1407 * If the fd as to be kept on its side, the application should duplicate the fd (e.g., using dup() )1411 //--------------------------------------------------------------------------------------------------1421 //--------------------------------------------------------------------------------------------------1430 * @note the fd is closed by the API. To record again the same file, the fd parameter can be set to1432 * If the fd as to be kept on its side, the application should duplicate the fd (e.g., using dup() )1436 //--------------------------------------------------------------------------------------------------1446 //--------------------------------------------------------------------------------------------------1454 * @note the fd is closed by the API. To use again the same pipe, the fd parameter can be set to1456 * If the fd as to be kept on its side, the application should duplicate the fd (e.g., using dup() )1459 //--------------------------------------------------------------------------------------------------1469 //--------------------------------------------------------------------------------------------------1479 //--------------------------------------------------------------------------------------------------1486 //--------------------------------------------------------------------------------------------------1494 //--------------------------------------------------------------------------------------------------1501 //--------------------------------------------------------------------------------------------------1509 //--------------------------------------------------------------------------------------------------1516 //--------------------------------------------------------------------------------------------------1524 //--------------------------------------------------------------------------------------------------1531 //--------------------------------------------------------------------------------------------------1539 //--------------------------------------------------------------------------------------------------1549 //--------------------------------------------------------------------------------------------------1557 //--------------------------------------------------------------------------------------------------1567 //--------------------------------------------------------------------------------------------------1575 //--------------------------------------------------------------------------------------------------1585 //--------------------------------------------------------------------------------------------------1593 //--------------------------------------------------------------------------------------------------1603 //--------------------------------------------------------------------------------------------------1611 //--------------------------------------------------------------------------------------------------1621 //--------------------------------------------------------------------------------------------------1629 //--------------------------------------------------------------------------------------------------1639 //--------------------------------------------------------------------------------------------------1652 //--------------------------------------------------------------------------------------------------1668 //--------------------------------------------------------------------------------------------------1670 * This function must be called to ask to the Mobile Network to generate on the remote audio party1681 //--------------------------------------------------------------------------------------------------1694 //--------------------------------------------------------------------------------------------------1702 //--------------------------------------------------------------------------------------------------1712 //--------------------------------------------------------------------------------------------------1720 //--------------------------------------------------------------------------------------------------1730 //--------------------------------------------------------------------------------------------------1738 //--------------------------------------------------------------------------------------------------1748 //--------------------------------------------------------------------------------------------------1756 //--------------------------------------------------------------------------------------------------1766 //--------------------------------------------------------------------------------------------------1774 //--------------------------------------------------------------------------------------------------1784 //--------------------------------------------------------------------------------------------------1792 //--------------------------------------------------------------------------------------------------1802 //--------------------------------------------------------------------------------------------------1813 //--------------------------------------------------------------------------------------------------1823 //--------------------------------------------------------------------------------------------------1833 //--------------------------------------------------------------------------------------------------1843 //--------------------------------------------------------------------------------------------------1850 //--------------------------------------------------------------------------------------------------1856 //--------------------------------------------------------------------------------------------------1863 //--------------------------------------------------------------------------------------------------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_DisableNoiseSuppressor(le_audio_StreamRef_t streamRef)le_result_t le_audio_Pause(le_audio_StreamRef_t streamRef)le_result_t le_audio_PlayDtmf(le_audio_StreamRef_t streamRef, const char *dtmf, uint32_t duration, uint32_t pause)uint32_t le_audio_GetPcmSamplingResolution(void)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_DisableEchoCanceller(le_audio_StreamRef_t streamRef)le_result_t le_audio_SetPcmSamplingRate(uint32_t rate)le_result_t le_audio_RecordFile(le_audio_StreamRef_t streamRef, int fd)MU-law PCM (i.e. North America and Japan).Definition: le_audio_interface.h:428le_audio_StreamRef_t le_audio_OpenModemVoiceTx(void)le_result_t le_audio_IsEchoCancellerEnabled(le_audio_StreamRef_t streamRef, bool *statusPtr)le_result_t le_audio_GetSampleAmrDtx(le_audio_StreamRef_t streamRef, bool *dtxPtr)le_audio_StreamRef_t le_audio_OpenI2sTx(le_audio_I2SChannel_t mode)void(* le_audio_DtmfDetectorHandlerFunc_t)(le_audio_StreamRef_t streamRef, char dtmf, void *contextPtr)Definition: le_audio_interface.h:651le_audio_StreamRef_t le_audio_OpenI2sRx(le_audio_I2SChannel_t mode)le_result_t le_audio_GetSamples(le_audio_StreamRef_t streamRef, int fd)le_result_t le_audio_Flush(le_audio_StreamRef_t streamRef)le_result_t le_audio_DisableIirFilter(le_audio_StreamRef_t streamRef)struct le_audio_Stream * le_audio_StreamRef_tDefinition: le_audio_interface.h:591AMR Narrowband in 7.4kbps (default value)Definition: le_audio_interface.h:502le_result_t le_audio_GetProfile(uint32_t *profilePtr)le_result_t le_audio_TryConnectService(void)le_audio_StreamRef_t le_audio_OpenUsbTx(void)le_result_t le_audio_Connect(le_audio_ConnectorRef_t connectorRef, le_audio_StreamRef_t streamRef)le_result_t le_audio_Unmute(le_audio_StreamRef_t streamRef)le_audio_StreamRef_t le_audio_OpenSpeaker(void)struct le_audio_Connector * le_audio_ConnectorRef_tDefinition: le_audio_interface.h:599le_result_t le_audio_GetPlatformSpecificGain(const char *gainName, int32_t *gainPtr)le_result_t le_audio_EnableFirFilter(le_audio_StreamRef_t streamRef)void le_audio_RemoveDtmfDetectorHandler(le_audio_DtmfDetectorHandlerRef_t addHandlerRef)uint32_t le_audio_GetPcmSamplingRate(void)le_result_t le_audio_MuteCallWaitingTone(void)le_result_t le_audio_PlaySamples(le_audio_StreamRef_t streamRef, int fd)le_audio_I2SChannel_t le_audio_GetDefaultI2sMode(void)struct le_audio_DtmfDetectorHandler * le_audio_DtmfDetectorHandlerRef_tDefinition: le_audio_interface.h:615le_result_t le_audio_DisableAutomaticGainControl(le_audio_StreamRef_t streamRef)le_audio_ConnectorRef_t le_audio_CreateConnector(void)le_result_t le_audio_PlayFile(le_audio_StreamRef_t streamRef, int fd)le_audio_StreamRef_t le_audio_OpenPcmTx(uint32_t timeslot)le_result_t le_audio_SetPcmCompanding(le_audio_Companding_t companding)le_result_t le_audio_GetSamplePcmSamplingResolution(le_audio_StreamRef_t streamRef, uint32_t *samplingResPtr)le_result_t le_audio_IsNoiseSuppressorEnabled(le_audio_StreamRef_t streamRef, bool *statusPtr)le_result_t le_audio_SetProfile(uint32_t profile)void(* le_audio_MediaHandlerFunc_t)(le_audio_StreamRef_t streamRef, le_audio_MediaEvent_t event, void *contextPtr)Definition: le_audio_interface.h:631le_audio_StreamRef_t le_audio_OpenModemVoiceRx(void)le_audio_StreamRef_t le_audio_OpenRecorder(void)le_result_t le_audio_Resume(le_audio_StreamRef_t streamRef)void le_audio_Close(le_audio_StreamRef_t streamRef)A-law PCM (i.e. Europe and most of the rest of the world).Definition: le_audio_interface.h:425le_audio_StreamRef_t le_audio_OpenPlayer(void)void le_audio_DisconnectService(void)uint32_t le_audio_GetDefaultPcmTimeSlot(void)le_result_t le_audio_Stop(le_audio_StreamRef_t streamRef)le_result_t le_audio_SetGain(le_audio_StreamRef_t streamRef, int32_t gain)le_audio_StreamRef_t le_audio_OpenPcmRx(uint32_t timeslot)le_result_t le_audio_SetPcmSamplingResolution(uint32_t bitsPerSample)struct le_audio_MediaHandler * le_audio_MediaHandlerRef_tDefinition: le_audio_interface.h:607le_result_t le_audio_SetEncodingFormat(le_audio_StreamRef_t streamRef, le_audio_Format_t format)le_audio_StreamRef_t le_audio_OpenUsbRx(void)le_result_t le_audio_EnableEchoCanceller(le_audio_StreamRef_t streamRef)le_result_t le_audio_SetSampleAmrMode(le_audio_StreamRef_t streamRef, le_audio_AmrMode_t mode)le_result_t le_audio_DisableFirFilter(le_audio_StreamRef_t streamRef)Recording/playback has encountered an error.Definition: le_audio_interface.h:409le_result_t le_audio_PlaySignallingDtmf(const char *dtmf, uint32_t duration, uint32_t pause)void le_audio_ConnectService(void)le_result_t le_audio_GetGain(le_audio_StreamRef_t streamRef, int32_t *gainPtr)le_result_t le_audio_SetSampleAmrDtx(le_audio_StreamRef_t streamRef, bool dtx)le_result_t le_audio_SetPlatformSpecificGain(const char *gainName, int32_t gain)le_result_t le_audio_SetSamplePcmSamplingResolution(le_audio_StreamRef_t streamRef, uint32_t samplingRes)le_audio_MediaHandlerRef_t le_audio_AddMediaHandler(le_audio_StreamRef_t streamRef, le_audio_MediaHandlerFunc_t handlerPtr, void *contextPtr)le_result_t le_audio_GetEncodingFormat(le_audio_StreamRef_t streamRef, le_audio_Format_t *formatPtr)le_audio_Companding_t le_audio_GetPcmCompanding(void)le_audio_DtmfDetectorHandlerRef_t le_audio_AddDtmfDetectorHandler(le_audio_StreamRef_t streamRef, le_audio_DtmfDetectorHandlerFunc_t handlerPtr, void *contextPtr)void le_audio_Disconnect(le_audio_ConnectorRef_t connectorRef, le_audio_StreamRef_t streamRef)void le_audio_DeleteConnector(le_audio_ConnectorRef_t connectorRef)le_result_t le_audio_EnableNoiseSuppressor(le_audio_StreamRef_t streamRef)le_result_t le_audio_UnmuteCallWaitingTone(void)void le_audio_RemoveMediaHandler(le_audio_MediaHandlerRef_t addHandlerRef)le_result_t le_audio_GetSampleAmrMode(le_audio_StreamRef_t streamRef, le_audio_AmrMode_t *modePtr)le_audio_StreamRef_t le_audio_OpenMic(void)le_result_t le_audio_EnableIirFilter(le_audio_StreamRef_t streamRef)le_result_t le_audio_EnableAutomaticGainControl(le_audio_StreamRef_t streamRef)le_result_t le_audio_Mute(le_audio_StreamRef_t streamRef)