#include "legato.h"
#include "taf_audio_common.h"
Go to the source code of this file.
|
void | taf_audio_ConnectService (void) |
|
le_result_t | taf_audio_TryConnectService (void) |
|
LE_FULL_API void | taf_audio_SetServerDisconnectHandler (taf_audio_DisconnectHandler_t disconnectHandler, void *contextPtr) |
|
LE_FULL_API void | taf_audio_SetNonExitServerDisconnectHandler (taf_audio_DisconnectHandler_t disconnectHandler, void *contextPtr) |
|
void | taf_audio_DisconnectService (void) |
|
void | taf_audio_Close (taf_audio_StreamRef_t sRef) |
|
taf_audio_ConnectorRef_t | taf_audio_CreateConnector (void) |
|
void | taf_audio_DeleteConnector (taf_audio_ConnectorRef_t connRef) |
|
le_result_t | taf_audio_Connect (taf_audio_ConnectorRef_t connRef, taf_audio_StreamRef_t sRef) |
|
void | taf_audio_Disconnect (taf_audio_ConnectorRef_t connRef, taf_audio_StreamRef_t sRef) |
|
taf_audio_StreamRef_t | taf_audio_OpenSpeaker (void) |
|
taf_audio_StreamRef_t | taf_audio_OpenMic (void) |
|
taf_audio_StreamRef_t | taf_audio_OpenModemVoiceRx (uint32_t slotId) |
|
taf_audio_StreamRef_t | taf_audio_OpenModemVoiceTx (uint32_t slotId) |
|
le_result_t | taf_audio_PlayDtmf (taf_audio_StreamRef_t streamRef, const char *LE_NONNULL dtmf, uint32_t duration, uint32_t pause) |
|
le_result_t | taf_audio_Mute (taf_audio_StreamRef_t streamRef) |
|
le_result_t | taf_audio_Unmute (taf_audio_StreamRef_t streamRef) |
|
taf_audio_StreamRef_t | taf_audio_OpenPlayer (void) |
|
le_result_t | taf_audio_PlayFile (taf_audio_StreamRef_t streamRef, int fd) |
|
taf_audio_StreamRef_t | taf_audio_OpenRecorder (void) |
|
le_result_t | taf_audio_RecordFile (taf_audio_StreamRef_t streamRef, int fd) |
|
taf_audio_MediaHandlerRef_t | taf_audio_AddMediaHandler (taf_audio_StreamRef_t streamRef, taf_audio_MediaHandlerFunc_t handlerPtr, void *contextPtr) |
|
void | taf_audio_RemoveMediaHandler (taf_audio_MediaHandlerRef_t handlerRef) |
|
taf_audio_DtmfDetectorHandlerRef_t | taf_audio_AddDtmfDetectorHandler (taf_audio_StreamRef_t streamRef, taf_audio_DtmfDetectorHandlerFunc_t handlerPtr, void *contextPtr) |
|
void | taf_audio_RemoveDtmfDetectorHandler (taf_audio_DtmfDetectorHandlerRef_t handlerRef) |
|
le_result_t | taf_audio_Stop (taf_audio_StreamRef_t streamRef) |
|
le_result_t | taf_audio_SetGain (taf_audio_StreamRef_t streamRef, int32_t gain) |
|
le_result_t | taf_audio_GetGain (taf_audio_StreamRef_t streamRef, int32_t *gainPtr) |
|
le_result_t | taf_audio_EnableNoiseSuppressor (taf_audio_StreamRef_t streamRef) |
|
le_result_t | taf_audio_EnableEchoCanceller (taf_audio_StreamRef_t streamRef) |
|
le_result_t | taf_audio_DisableNoiseSuppressor (taf_audio_StreamRef_t streamRef) |
|
le_result_t | taf_audio_DisableEchoCanceller (taf_audio_StreamRef_t streamRef) |
|
le_result_t | taf_audio_IsEchoCancellerEnabled (taf_audio_StreamRef_t streamRef, bool *statusPtr) |
|
le_result_t | taf_audio_IsNoiseSuppressorEnabled (taf_audio_StreamRef_t streamRef, bool *statusPtr) |
|
taf_audio_StreamRef_t | taf_audio_OpenI2sRx (taf_audio_I2SChannel_t mode) |
|
taf_audio_StreamRef_t | taf_audio_OpenI2sTx (taf_audio_I2SChannel_t mode) |
|
taf_audio_StreamRef_t | taf_audio_OpenPcmRx (uint32_t timeslot) |
|
taf_audio_StreamRef_t | taf_audio_OpenPcmTx (uint32_t timeslot) |
|
le_result_t | taf_audio_SetSamplePcmSamplingRate (taf_audio_StreamRef_t streamRef, uint32_t rate) |
|
le_result_t | taf_audio_GetSamplePcmSamplingRate (taf_audio_StreamRef_t streamRef, uint32_t *ratePtr) |
|
le_result_t | taf_audio_SetSamplePcmChannelNumber (taf_audio_StreamRef_t streamRef, uint32_t nbChannel) |
|
le_result_t | taf_audio_GetSamplePcmChannelNumber (taf_audio_StreamRef_t streamRef, uint32_t *nbChannelPtr) |
|
le_result_t | taf_audio_SetEncodingFormat (taf_audio_StreamRef_t streamRef, taf_audio_Format_t format) |
|
le_result_t | taf_audio_GetEncodingFormat (taf_audio_StreamRef_t streamRef, taf_audio_Format_t *formatPtr) |
|
◆ taf_audio_DisconnectHandler_t
typedef void(* taf_audio_DisconnectHandler_t) (void *) |
Type for handler called when a server disconnects.
◆ taf_audio_ConnectService()
void taf_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 apiFilesC_client.
This function is created automatically.
◆ taf_audio_TryConnectService()
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 apiFilesC_client.
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.
◆ taf_audio_SetServerDisconnectHandler()
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.
◆ taf_audio_SetNonExitServerDisconnectHandler()
Set handler called when server disconnection is detected without exiting.
When a server connection is lost, call this handler without exit.
- Warning
- When using the API, it needs the application developer to handle some cases like re-connecting and recycling the resources. For most of cases, it is safe to use SetServerDisconnectHandler.
◆ taf_audio_DisconnectService()
void taf_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 apiFilesC_client.
This function is created automatically.
◆ taf_audio_Close()
Closes the stream reference.
- Parameters
-
[in] | sRef | Audio stream reference. |
◆ taf_audio_CreateConnector()
Creates a new connector.
- Returns
- Reference to the audio stream, NULL on error.
◆ taf_audio_DeleteConnector()
Deletes a connected connector.
- Note
- This function will not return if passed a bad reference.
- Parameters
-
[in] | connRef | Connector reference. |
◆ taf_audio_Connect()
Connects a connector for an audio stream reference.
- Returns
- LE_OK Success.
- LE_FAULT Failure.
- Note
- This function will not return if passed a bad reference.
- Parameters
-
[in] | connRef | Connector reference. |
[in] | sRef | Audio stream reference. |
◆ taf_audio_Disconnect()
Disconnects a connector for an audio stream reference.
- Note
- This function will not return if passed a bad reference.
- Parameters
-
[in] | connRef | Connector reference. |
[in] | sRef | Audio stream reference. |
◆ taf_audio_OpenSpeaker()
Opens an audio stream reference for speaker use.
- Returns
- Reference to the audio stream, NULL on error.
◆ taf_audio_OpenMic()
Opens an audio stream reference for microphone use.
- Returns
- Reference to an audio stream, NULL on error.
◆ taf_audio_OpenModemVoiceRx()
Opens an audio stream reference for voice Rx.
- Returns
- Reference to an audio stream, NULL on error.
- Parameters
-
◆ taf_audio_OpenModemVoiceTx()
Opens an audio stream reference for voice Tx.
- Returns
- Reference to an audio stream, NULL on error.
- Parameters
-
◆ taf_audio_PlayDtmf()
DTMF playback for inband.
- Note
- Applicable only for voice streams.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[in] | dtmf | DTMF data. |
[in] | duration | Duration to play. |
[in] | pause | Pause between tones. |
◆ taf_audio_Mute()
Mutes an audio stream.
- Returns
- LE_OK Success.
- LE_FAULT Failure.
- Parameters
-
[in] | streamRef | Audio stream reference. |
◆ taf_audio_Unmute()
Unmutes an audio stream.
- Returns
- LE_OK Success.
- LE_FAULT Failure.
- Parameters
-
[in] | streamRef | Audio stream reference. |
◆ taf_audio_OpenPlayer()
Opens a stream for audio playback.
- Returns
- Reference to an audio stream, NULL on error.
◆ taf_audio_PlayFile()
Plays a file on a playback stream.
- Returns
- LE_FAULT Failure.
- LE_BAD_PARAMETER Invalid stream reference.
- LE_BUSY Already active.
- LE_OK Success.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[in] | fd | File descriptor. |
◆ taf_audio_OpenRecorder()
Opens the audio stream for recording.
- Returns
- Reference to an audio stream, NULL on error.
◆ taf_audio_RecordFile()
Records a file on the recorder stream.
- Returns
- LE_FAULT Failure.
- LE_BAD_PARAMETER Invalid stream reference.
- LE_BUSY Already active.
- LE_OK Success.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[in] | fd | File descriptor. |
◆ taf_audio_AddMediaHandler()
Add handler function for EVENT 'taf_audio_Media'
This event provides information on player/recorder stream events.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[in] | handlerPtr | Media handler. |
[in] | contextPtr | |
◆ taf_audio_RemoveMediaHandler()
Remove handler function for EVENT 'taf_audio_Media'
- Parameters
-
◆ taf_audio_AddDtmfDetectorHandler()
Add handler function for EVENT 'taf_audio_DtmfDetector'
This event provides information on DTMF decoding for the specified streamRef.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[in] | handlerPtr | DTMF Handler. |
[in] | contextPtr | |
◆ taf_audio_RemoveDtmfDetectorHandler()
Remove handler function for EVENT 'taf_audio_DtmfDetector'
- Parameters
-
◆ taf_audio_Stop()
Stops the file playback or recording.
- Returns
- LE_OK Success.
- LE_FAULT Failure.
- Parameters
-
[in] | streamRef | Audio stream reference. |
◆ taf_audio_SetGain()
Sets the volume.
- Returns
- LE_FAULT Failure.
- LE_OK Success.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[in] | gain | Set gain parameter. |
◆ taf_audio_GetGain()
Gets the volume.
- Returns
- LE_FAULT Failure.
- LE_OK Success.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[out] | gainPtr | Gain parameter. |
◆ taf_audio_EnableNoiseSuppressor()
Enables noise suppression.
- Returns
- LE_FAULT Failure.
- LE_OK Success.
- Parameters
-
[in] | streamRef | Audio stream reference. |
◆ taf_audio_EnableEchoCanceller()
Enables echo cancellation.
- Returns
- LE_FAULT Failure.
- LE_OK Success.
- Parameters
-
[in] | streamRef | Audio stream reference. |
◆ taf_audio_DisableNoiseSuppressor()
Disables noise suppression.
- Returns
- LE_FAULT Failure.
- LE_OK Success.
- Parameters
-
[in] | streamRef | Audio stream reference. |
◆ taf_audio_DisableEchoCanceller()
Sets the volume.
- Returns
- LE_FAULT Failure.
- LE_OK Success.
- Parameters
-
[in] | streamRef | Audio stream reference. |
◆ taf_audio_IsEchoCancellerEnabled()
Gets echo cancellation status.
- Returns
- LE_FAULT Failure.
- LE_OK Success.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[out] | statusPtr | Check for EchoCanceller flag. |
◆ taf_audio_IsNoiseSuppressorEnabled()
Gets noise suppression status.
- Returns
- LE_FAULT Failure.
- LE_OK Success.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[out] | statusPtr | Check for NoiseSuppressor flag. |
◆ taf_audio_OpenI2sRx()
Opens an audio stream reference for I2S Rx interface use.
- Note
- Set the sampling rate using taf_audio_SetSamplePcmSamplingRate after creating the stream reference and before connecting, otherwise the defalut sampling rate will be 16000.
- Returns
- Reference to the audio stream, NULL on error.
- Parameters
-
[in] | mode | The channel mode. |
◆ taf_audio_OpenI2sTx()
Opens an audio stream reference for I2S Tx interface use.
- Note
- Set the sampling rate using taf_audio_SetSamplePcmSamplingRate after creating the stream reference and before connecting, otherwise the defalut sampling rate will be 16000.
- Returns
- Reference to the audio stream, NULL on error.
- Parameters
-
[in] | mode | The channel mode. |
◆ taf_audio_OpenPcmRx()
Opens an audio stream reference for PCM Rx interface use.
- Note
- Set the sampling rate using taf_audio_SetSamplePcmSamplingRate after creating the stream reference and before connecting, otherwise the defalut sampling rate will be 16000.
- Returns
- Reference to the audio stream, NULL on error.
- Parameters
-
[in] | timeslot | The time slot number. |
◆ taf_audio_OpenPcmTx()
Opens an audio stream reference for PCM Tx interface use.
- Note
- Set the sampling rate using taf_audio_SetSamplePcmSamplingRate after creating the stream reference and before connecting, otherwise the defalut sampling rate will be 16000.
- Returns
- Reference to the audio stream, NULL on error.
- Parameters
-
[in] | timeslot | The time slot number. |
◆ taf_audio_SetSamplePcmSamplingRate()
Sets the sampling rate of a stream reference.
- Returns
- LE_OK Succeeded.
- LE_FAULT Failed.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[in] | rate | Sampling rate. |
◆ taf_audio_GetSamplePcmSamplingRate()
Gets the sampling rate of the stream reference.
- Returns
- LE_FAULT Failed.
- LE_OK Function succeeded.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[out] | ratePtr | Sampling rate. |
◆ taf_audio_SetSamplePcmChannelNumber()
Sets the channel number for the stream reference.
- Returns
- LE_FAULT Failed.
- LE_OK Succeeded.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[in] | nbChannel | Channel number. |
◆ taf_audio_GetSamplePcmChannelNumber()
Gets the channel number of the recorder stream reference.
- Returns
- LE_FAULT Failed.
- LE_OK Succeeded.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[out] | nbChannelPtr | Channel number. |
◆ taf_audio_SetEncodingFormat()
Sets the encoding format of a recorder stream reference.
- Returns
- LE_FAULT Failed.
- LE_OK Succeeded.
- Parameters
-
[in] | streamRef | Audio stream reference. |
[in] | format | Encoding format. |
◆ taf_audio_GetEncodingFormat()
Gets the encoding format of a recorder stream reference.
- Returns
- LE_FAULT Failed.
- LE_OK 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. |