All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
le_audio_interface.h File Reference
#include "legato.h"

Go to the source code of this file.

Typedefs

typedef struct le_audio_Stream * le_audio_StreamRef_t
 
typedef struct le_audio_Connector * le_audio_ConnectorRef_t
 

Enumerations

enum  le_audio_I2SChannel_t {
  LE_AUDIO_I2S_LEFT, LE_AUDIO_I2S_RIGHT, LE_AUDIO_I2S_MONO, LE_AUDIO_I2S_STEREO,
  LE_AUDIO_I2S_REVERSE
}
 

Functions

void le_audio_StartClient (const char *serviceInstanceName)
 
void le_audio_StopClient (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_OpenFilePlayback (int fd)
 
le_audio_StreamRef_t le_audio_OpenFileRecording (int fd)
 
le_audio_StreamRef_t le_audio_OpenModemVoiceRx (void)
 
le_audio_StreamRef_t le_audio_OpenModemVoiceTx (void)
 
le_result_t le_audio_GetFormat (le_audio_StreamRef_t streamRef, char *formatPtr, size_t formatPtrNumElements)
 
void le_audio_Close (le_audio_StreamRef_t streamRef)
 
le_result_t le_audio_SetGain (le_audio_StreamRef_t streamRef, uint32_t gain)
 
le_result_t le_audio_GetGain (le_audio_StreamRef_t streamRef, uint32_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)
 

Detailed Description

Legato Audio Service include file.

Copyright (C) Sierra Wireless, Inc. 2014. Use of this work is subject to license.

Typedef Documentation

typedef struct le_audio_Connector* le_audio_ConnectorRef_t

Reference type for Audio Connector

typedef struct le_audio_Stream* le_audio_StreamRef_t

Reference type for Audio Stream

Enumeration Type Documentation

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

Function Documentation

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.
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.
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.
le_result_t le_audio_GetFormat ( le_audio_StreamRef_t  streamRef,
char *  formatPtr,
size_t  formatPtrNumElements 
)

Get the audio format 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]streamRefThe audio stream reference.
[out]formatPtrThe name of the audio encoding as used by the Real-Time Protocol (RTP), specified by the IANA organisation.
[in]formatPtrNumElements
le_result_t le_audio_GetGain ( le_audio_StreamRef_t  streamRef,
uint32_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
The hardware may or may not support the full 0-100 resolution, and if you want to see what was actually set call le_audio_GetGain() after le_audio_SetGain() to get the real value.
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 [0..100] (0 means 'muted', 100 is the maximum gain value)
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]streamRefThe audio stream reference.
le_audio_StreamRef_t le_audio_OpenFilePlayback ( int  fd)

Open the audio stream for file playback.

Returns
Reference to the audio stream, NULL if the function fails.
Parameters
[in]fdThe file descriptor.
le_audio_StreamRef_t le_audio_OpenFileRecording ( int  fd)

Open the audio stream for file recording.

Returns
Reference to the audio stream, NULL if the function fails.
Parameters
[in]fdThe file descriptor.
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_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_SetGain ( le_audio_StreamRef_t  streamRef,
uint32_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 parameter is not between 0 and 100
LE_OK Function succeeded.
Note
The hardware may or may not support the full 0-100 resolution, and if you want to see what was actually set call le_audio_GetGain() after le_audio_SetGain() to get the real value.
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 [0..100] (0 means 'muted', 100 is the maximum gain value)
void le_audio_StartClient ( const char *  serviceInstanceName)

Start the service for the client main thread

Parameters
[in]serviceInstanceName
void le_audio_StopClient ( void  )

Stop the service for the current client thread

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.