Telematics SDK - Interface Specification  v1.13.0
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages

Data Structures

struct  telux::audio::StreamConfig
 
struct  telux::audio::ChannelVolume
 
struct  telux::audio::StreamVolume
 
struct  telux::audio::StreamMute
 
struct  telux::audio::StreamBuffer
 
class  telux::audio::AudioFactory
 AudioFactory allows creation of audio manager. More...
 
class  telux::audio::IAudioManager
 Audio Manager is a primary interface for audio operations. It provide APIs to manage Streams ( like voice, play, record etc) and sound cards. More...
 
class  telux::audio::IAudioDevice
 Audio device and it's characteristics like Direction (Sink or Source), type. More...
 
class  telux::audio::IAudioStream
 IAudioStream represents single audio stream with base properties. More...
 
class  telux::audio::IAudioVoiceStream
 IAudioVoiceStream represents single voice stream. More...
 
class  telux::audio::IAudioPlayStream
 IAudioPlayStream represents single audio playback stream. More...
 
class  telux::audio::IAudioCaptureStream
 IAudioCaptureStream represents single audio capture stream. More...
 

Typedefs

using telux::audio::ChannelTypeMask = int
 
using telux::audio::GetDevicesResponseCb = std::function< void(std::vector< std::shared_ptr< IAudioDevice >> devices, telux::common::ErrorCode error)>
 
using telux::audio::GetStreamTypesResponseCb = std::function< void(std::vector< StreamType > streamTypes, telux::common::ErrorCode error)>
 
using telux::audio::CreateStreamResponseCb = std::function< void(std::shared_ptr< IAudioStream > &stream, telux::common::ErrorCode error)>
 
using telux::audio::DeleteStreamResponseCb = std::function< void(telux::common::ErrorCode error)>
 
using telux::audio::GetStreamDeviceResponseCb = std::function< void(std::vector< DeviceType > devices, telux::common::ErrorCode error)>
 
using telux::audio::GetStreamVolumeResponseCb = std::function< void(StreamVolume volume, telux::common::ErrorCode error)>
 
using telux::audio::GetStreamMuteResponseCb = std::function< void(StreamMute mute, telux::common::ErrorCode error)>
 

Enumerations

enum  telux::audio::DeviceType { telux::audio::DEVICE_TYPE_NONE = -1, telux::audio::DEVICE_TYPE_SPEAKER = 1, telux::audio::DEVICE_TYPE_MIC = 257 }
 
enum  telux::audio::DeviceDirection { telux::audio::DeviceDirection::NONE = -1, telux::audio::DeviceDirection::RX = 1, telux::audio::DeviceDirection::TX = 2 }
 
enum  telux::audio::StreamType { telux::audio::StreamType::NONE = -1, telux::audio::StreamType::VOICE_CALL = 1, telux::audio::StreamType::PLAY = 2, telux::audio::StreamType::CAPTURE = 3 }
 
enum  telux::audio::StreamDirection { telux::audio::StreamDirection::NONE = -1, telux::audio::StreamDirection::RX = 1, telux::audio::StreamDirection::TX = 2 }
 
enum  telux::audio::ChannelType { telux::audio::LEFT = (1 << 0), telux::audio::RIGHT = (1 << 1) }
 
enum  telux::audio::AudioFormat { telux::audio::AudioFormat::UNKNOWN = -1, telux::audio::AudioFormat::PCM_16BIT_SIGNED = 1 }
 

Detailed Description

This section contains APIs related to Audio Stream operation.


Data Structure Documentation

struct telux::audio::StreamConfig

Common Stream configuration parameters

Data Fields
StreamType type
int modemSubId

Represents modem Subscription ID, Default set to 1. Applicable only for Voice Call

uint32_t sampleRate

Sample Rate of Stream, Typical Values <8k/16k/32k/48k>

ChannelTypeMask channelTypeMask
AudioFormat format
vector< DeviceType > deviceTypes
struct telux::audio::ChannelVolume

Stream Channel Volume parameters

Data Fields
ChannelType channelType
float vol

Volume range in float <0 to 1.0>. 0 represents min volume, 1 represents max volume

struct telux::audio::StreamVolume

Stream Channel Volume parameters consolidating entire Stream

Data Fields
vector< ChannelVolume > volume
StreamDirection dir
struct telux::audio::StreamMute

Stream Mute parameters

Data Fields
bool enable
StreamDirection dir
struct telux::audio::StreamBuffer

Stream Data Buffer

Data Fields
vector< uint8_t > buffer

Buffer with Size encapsulated

size_t offset

Actual Buffer Content starting position

int64_t timestamp

For future use

class telux::audio::AudioFactory

AudioFactory allows creation of audio manager.

Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

Public Member Functions

std::shared_ptr< IAudioManagergetAudioManager ()
 
 ~AudioFactory ()
 

Static Public Member Functions

static AudioFactorygetInstance ()
 

Constructor & Destructor Documentation

telux::audio::AudioFactory::~AudioFactory ( )

Member Function Documentation

static AudioFactory& telux::audio::AudioFactory::getInstance ( )
static

Get Audio Factory instance.

std::shared_ptr<IAudioManager> telux::audio::AudioFactory::getAudioManager ( )

Get instance of audio manager.

Returns
IAudioManager pointer.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
class telux::audio::IAudioManager

Audio Manager is a primary interface for audio operations. It provide APIs to manage Streams ( like voice, play, record etc) and sound cards.

Public Member Functions

virtual bool isSubsystemReady ()=0
 
virtual std::future< bool > onSubsystemReady ()=0
 
virtual telux::common::Status getDevices (GetDevicesResponseCb callback=nullptr)=0
 
virtual telux::common::Status getStreamTypes (GetStreamTypesResponseCb callback=nullptr)=0
 
virtual telux::common::Status createStream (StreamConfig streamConfig, CreateStreamResponseCb callback=nullptr)=0
 
virtual telux::common::Status deleteStream (std::shared_ptr< IAudioStream > stream, DeleteStreamResponseCb callback=nullptr)=0
 

Member Function Documentation

virtual bool telux::audio::IAudioManager::isSubsystemReady ( )
pure virtual

Checks the status of audio subsystems and returns the result.

Returns
If true that means AudioManager is ready for performing audio operations.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual std::future<bool> telux::audio::IAudioManager::onSubsystemReady ( )
pure virtual

Wait for Audio subsystem to be ready.

Returns
A future that caller can wait on to be notified when audio subsystem is ready.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::IAudioManager::getDevices ( GetDevicesResponseCb  callback = nullptr)
pure virtual

Get the list of supported audio devices, which are currently supported in the audio subsystem

Parameters
[in]callbackcallback pointer to get the response of getDevices.
Returns
Status of request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::IAudioManager::getStreamTypes ( GetStreamTypesResponseCb  callback = nullptr)
pure virtual

Get the list of supported audio streams types, which are currently supported in the audio subsystem

Parameters
[in]callbackcallback pointer to get the response of getStreamTypes.
Returns
Status of request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::IAudioManager::createStream ( StreamConfig  streamConfig,
CreateStreamResponseCb  callback = nullptr 
)
pure virtual

Creates the stream for audio operation

Parameters
[in]streamConfigstream configuration.
[in]callbackcallback pointer to get the response of createStream.
Returns
Status of request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::IAudioManager::deleteStream ( std::shared_ptr< IAudioStream stream,
DeleteStreamResponseCb  callback = nullptr 
)
pure virtual

Deletes the specified stream which was created before

Parameters
[in]streamreference to stream to be deleted.
[in]callbackcallback pointer to get the response of deleteStream.
Returns
Status of request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
class telux::audio::IAudioDevice

Audio device and it's characteristics like Direction (Sink or Source), type.

Public Member Functions

virtual DeviceType getType ()=0
 
virtual DeviceDirection getDirection ()=0
 

Member Function Documentation

virtual DeviceType telux::audio::IAudioDevice::getType ( )
pure virtual

Get the type of Device (i.e SPEAKER, MIC etc)

Returns
DeviceType
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual DeviceDirection telux::audio::IAudioDevice::getDirection ( )
pure virtual

Provide direction of device whether is Sink for audio data ( RX i.e. speaker, etc) or Source for audio data ( TX i.e. mic, etc)

Returns
DeviceDirection
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
class telux::audio::IAudioStream

IAudioStream represents single audio stream with base properties.

Public Member Functions

virtual StreamType getType ()=0
 
virtual telux::common::Status setDevice (std::vector< DeviceType > devices, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status getDevice (GetStreamDeviceResponseCb callback=nullptr)=0
 
virtual telux::common::Status setVolume (StreamVolume volume, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status getVolume (StreamDirection dir, GetStreamVolumeResponseCb callback=nullptr)=0
 
virtual telux::common::Status setMute (StreamMute mute, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status getMute (StreamDirection dir, GetStreamMuteResponseCb callback=nullptr)=0
 

Member Function Documentation

virtual StreamType telux::audio::IAudioStream::getType ( )
pure virtual

Get the stream type like VOICE, PLAY, CAPTURE

Returns
StreamType
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::IAudioStream::setDevice ( std::vector< DeviceType devices,
telux::common::ResponseCallback  callback = nullptr 
)
pure virtual

Set Device of audio stream

Parameters
[in]devicesDevices list.
[in]callbackcallback to get the response of setDevice.
Returns
Status of the request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::IAudioStream::getDevice ( GetStreamDeviceResponseCb  callback = nullptr)
pure virtual

Get Device of audio stream

Parameters
[in]callbackcallback to get the response of getDevice
Returns
Status of the request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::IAudioStream::setVolume ( StreamVolume  volume,
telux::common::ResponseCallback  callback = nullptr 
)
pure virtual

Set Volume of audio stream

Parameters
[in]volumevolume setting per channel for direction.
[in]callbackcallback to get the response of setVolume.
Returns
Status of the request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::IAudioStream::getVolume ( StreamDirection  dir,
GetStreamVolumeResponseCb  callback = nullptr 
)
pure virtual

Get Volume of audio stream

Parameters
[in]dirStream Direction to query volume details.
[in]callbackcallback to get the response of getVolume.
Returns
Status of the request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::IAudioStream::setMute ( StreamMute  mute,
telux::common::ResponseCallback  callback = nullptr 
)
pure virtual

Set Mute of audio stream

Parameters
[in]mutemute setting for direction.
[in]callbackcallback to know the status of the request.
Returns
Status of the request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::IAudioStream::getMute ( StreamDirection  dir,
GetStreamMuteResponseCb  callback = nullptr 
)
pure virtual

Get Mute of audio stream

Parameters
[in]dirStream Direction to query mute details.
[in]callbackcallback to get the response of getMute.
Returns
Status of the request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
class telux::audio::IAudioVoiceStream

IAudioVoiceStream represents single voice stream.

Public Member Functions

virtual telux::common::Status startAudio (telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status stopAudio (telux::common::ResponseCallback callback=nullptr)=0
 
- Public Member Functions inherited from telux::audio::IAudioStream
virtual StreamType getType ()=0
 
virtual telux::common::Status setDevice (std::vector< DeviceType > devices, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status getDevice (GetStreamDeviceResponseCb callback=nullptr)=0
 
virtual telux::common::Status setVolume (StreamVolume volume, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status getVolume (StreamDirection dir, GetStreamVolumeResponseCb callback=nullptr)=0
 
virtual telux::common::Status setMute (StreamMute mute, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status getMute (StreamDirection dir, GetStreamMuteResponseCb callback=nullptr)=0
 

Member Function Documentation

virtual telux::common::Status telux::audio::IAudioVoiceStream::startAudio ( telux::common::ResponseCallback  callback = nullptr)
pure virtual

Starts audio stream

Parameters
[in]callbackcallback to get the response of startAudio.
Returns
Status of the request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::audio::IAudioVoiceStream::stopAudio ( telux::common::ResponseCallback  callback = nullptr)
pure virtual

Stops audio stream

Parameters
[in]callbackcallback to get the response of stopAudio.
Returns
Status of the request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
class telux::audio::IAudioPlayStream

IAudioPlayStream represents single audio playback stream.

Public Member Functions

virtual telux::common::Status write (StreamBuffer buffer, telux::common::ResponseCallback callback=nullptr)=0
 
- Public Member Functions inherited from telux::audio::IAudioStream
virtual StreamType getType ()=0
 
virtual telux::common::Status setDevice (std::vector< DeviceType > devices, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status getDevice (GetStreamDeviceResponseCb callback=nullptr)=0
 
virtual telux::common::Status setVolume (StreamVolume volume, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status getVolume (StreamDirection dir, GetStreamVolumeResponseCb callback=nullptr)=0
 
virtual telux::common::Status setMute (StreamMute mute, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status getMute (StreamDirection dir, GetStreamMuteResponseCb callback=nullptr)=0
 

Member Function Documentation

virtual telux::common::Status telux::audio::IAudioPlayStream::write ( StreamBuffer  buffer,
telux::common::ResponseCallback  callback = nullptr 
)
pure virtual

Write Samples to audio stream. First write starts playback operation.

Parameters
[in]bufferstream buffer for write.
[in]callbackcallback to get the response of write.
Returns
Status of the request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
class telux::audio::IAudioCaptureStream

IAudioCaptureStream represents single audio capture stream.

Public Member Functions

virtual telux::common::Status read (StreamBuffer &buffer, telux::common::ResponseCallback callback=nullptr)=0
 
- Public Member Functions inherited from telux::audio::IAudioStream
virtual StreamType getType ()=0
 
virtual telux::common::Status setDevice (std::vector< DeviceType > devices, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status getDevice (GetStreamDeviceResponseCb callback=nullptr)=0
 
virtual telux::common::Status setVolume (StreamVolume volume, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status getVolume (StreamDirection dir, GetStreamVolumeResponseCb callback=nullptr)=0
 
virtual telux::common::Status setMute (StreamMute mute, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status getMute (StreamDirection dir, GetStreamMuteResponseCb callback=nullptr)=0
 

Member Function Documentation

virtual telux::common::Status telux::audio::IAudioCaptureStream::read ( StreamBuffer buffer,
telux::common::ResponseCallback  callback = nullptr 
)
pure virtual

Read Samples from audio stream. First read starts capture operation.

Parameters
[in]bufferstream buffer for read.
[in]callbackcallback to get the response of read.
Returns
Status of the request i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

Typedef Documentation

using telux::audio::ChannelTypeMask = typedef int

Represent Stream's consolidated lists of Channel presence

using telux::audio::GetDevicesResponseCb = typedef std::function<void(std::vector<std::shared_ptr<IAudioDevice>> devices, telux::common::ErrorCode error)>

This function is called with the response to getDevices API.

The callback can be invoked from multiple different threads. The implementation should be thread safe.

Parameters
[in]devicesDevices list.
[in]errorReturn code which indicates whether the operation succeeded or not. ErrorCode
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
using telux::audio::GetStreamTypesResponseCb = typedef std::function<void(std::vector<StreamType> streamTypes, telux::common::ErrorCode error)>

This function is called with the response to getStreamTypes API.

The callback can be invoked from multiple different threads. The implementation should be thread safe.

Parameters
[in]streamTypesStream type list.
[in]errorReturn code which indicates whether the operation succeeded or not. ErrorCode
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
using telux::audio::CreateStreamResponseCb = typedef std::function<void(std::shared_ptr<IAudioStream> &stream, telux::common::ErrorCode error)>

This function is called with the response to createStream API.

The callback can be invoked from multiple different threads. The implementation should be thread safe.

Parameters
[in]streamInterface pointer of Stream created. VOICE_CALL - Provides IAudioVoiceStream pointer PLAY - Provides IAudioPlayStream pointer CAPTURE - Provides IAudioCaptureStream pointer
[in]errorReturn code which indicates whether the operation succeeded or not. ErrorCode
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
using telux::audio::DeleteStreamResponseCb = typedef std::function<void(telux::common::ErrorCode error)>

This function is called with the response to deleteStream API.

The callback can be invoked from multiple different threads. The implementation should be thread safe.

Parameters
[in]errorReturn code which indicates whether the operation succeeded or not. ErrorCode
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
using telux::audio::GetStreamDeviceResponseCb = typedef std::function<void(std::vector<DeviceType> devices, telux::common::ErrorCode error)>

This function is called with the response to stream getDevice API.

The callback can be invoked from multiple different threads. The implementation should be thread safe.

Parameters
[in]devicesDevices list.
[in]errorReturn code which indicates whether the operation succeeded or not. ErrorCode
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
using telux::audio::GetStreamVolumeResponseCb = typedef std::function<void(StreamVolume volume, telux::common::ErrorCode error)>

This function is called with the response to stream getVolume API.

The callback can be invoked from multiple different threads. The implementation should be thread safe.

Parameters
[in]volumestream volume details.
[in]errorReturn code which indicates whether the operation succeeded or not. ErrorCode
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
using telux::audio::GetStreamMuteResponseCb = typedef std::function<void(StreamMute mute, telux::common::ErrorCode error)>

This function is called with the response to stream getMute API.

The callback can be invoked from multiple different threads. The implementation should be thread safe.

Parameters
[in]mutestream mute details.
[in]errorReturn code which indicates whether the operation succeeded or not. ErrorCode
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

Enumeration Type Documentation

Represent type of device like SPEAKER, MIC, etc.

Enumerator
DEVICE_TYPE_NONE 
DEVICE_TYPE_SPEAKER 
DEVICE_TYPE_MIC 

Represent Device Direction RX (Sink), Tx (Source)

Enumerator
NONE 
RX 
TX 

Represent Stream Type

Enumerator
NONE 
VOICE_CALL 

Voice Call, Provides Audio Session for an active Voice

PLAY 

Plaback, Provides Audio Playback Session

CAPTURE 

Capture, Provides Audio Capture/Record Session

Represent Stream Direction

Enumerator
NONE 
RX 

Represents Session Directed towards Sink Device

TX 

Represents Session Directed from Source Device

Represent Stream's types of Channel

Enumerator
LEFT 

Represents left channel

RIGHT 

Represents right channel

Specifies Stream data format

Enumerator
UNKNOWN 

Unknown format

PCM_16BIT_SIGNED