interfaces/audio/c/le_audio.h File Reference
#include "legato.h"
#include "le_audio_defs.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

Functions

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_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 len)
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. 2013. All rights reserved. Use of this work is subject to license.

Legato Audio Service include file.

Copyright (C) Sierra Wireless, Inc. 2013. All rights reserved.


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


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.

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.

Create an audio connector reference.

Returns:
Reference to the audio connector, NULL if the function fails.

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

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]lenThe length of format string.
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)

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.

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.

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.

Open the Microphone.

Returns:
Reference to the input audio stream, NULL if the function fails.

Open the received audio stream of a voice call.

Returns:
Reference to the input audio stream, NULL if the function fails.

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.

Open the Speakerphone.

Returns:
Reference to the output audio stream, NULL if the function fails.

Open the received audio stream of an USB audio class.

Returns:
Reference to the input audio stream, NULL if the function fails.

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)

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.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines