Telematics SDK - Interface Specification  v1.26.3

Data Structures

struct  telux::audio::FormatParams
 
struct  telux::audio::AmrwbpParams
 
struct  telux::audio::StreamConfig
 
struct  telux::audio::FormatInfo
 
struct  telux::audio::ChannelVolume
 
struct  telux::audio::StreamVolume
 
struct  telux::audio::StreamMute
 
struct  telux::audio::StreamBuffer
 
struct  telux::audio::DtmfTone
 
class  telux::audio::AudioFactory
 AudioFactory allows creation of audio manager. More...
 
class  telux::audio::IVoiceListener
 Listener class for getting notifications related to DTMF tone detection. The client needs to implement these methods as briefly as possible and avoid blocking calls in it. The methods in this class can be invoked from multiple different threads. Client needs to make sure that the implementation is thread-safe. More...
 
class  telux::audio::IPlayListener
 
class  telux::audio::ITranscodeListener
 
class  telux::audio::IAudioBuffer
 Stream Buffer manages the buffer to be used for read and write operations on Audio Streams. For write operations, applications should request a stream buffer, populate it with the data and then pass it to the write operation and set the dataSize that is to be written to the stream. Similarly for read operations,the application should request a stream buffer and use that in the read operation. At the end of the read, the stream buffer will contain the data read. Once an operation (read/write) has completed, the stream buffer could be reused for a subsequent read/write operation, provided reset() API called on stream buffer between subsequent calls. More...
 
class  telux::audio::IStreamBuffer
 
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...
 
class  telux::audio::IAudioLoopbackStream
 IAudioLoopbackStream represents audio loopback stream. More...
 
class  telux::audio::IAudioToneGeneratorStream
 IAudioToneGeneratorStream represents tone generator 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::CreateTranscoderResponseCb = std::function< void(std::shared_ptr< ITranscoder > &transcoder, 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)>
 
using telux::audio::WriteResponseCb = std::function< void(std::shared_ptr< IStreamBuffer > buffer, uint32_t bytesWritten, telux::common::ErrorCode error)>
 
using telux::audio::ReadResponseCb = std::function< void(std::shared_ptr< IStreamBuffer > buffer, 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::Direction { telux::audio::Direction::RX = 1, telux::audio::Direction::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,
  telux::audio::StreamType::LOOPBACK = 4, telux::audio::StreamType::TONE_GENERATOR = 5
}
 
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, telux::audio::AudioFormat::AMRNB = 20, telux::audio::AudioFormat::AMRWB,
  telux::audio::AudioFormat::AMRWB_PLUS
}
 
enum  telux::audio::DtmfLowFreq { telux::audio::DtmfLowFreq::FREQ_697 = 697, telux::audio::DtmfLowFreq::FREQ_770 = 770, telux::audio::DtmfLowFreq::FREQ_852 = 852, telux::audio::DtmfLowFreq::FREQ_941 = 941 }
 
enum  telux::audio::DtmfHighFreq { telux::audio::DtmfHighFreq::FREQ_1209 = 1209, telux::audio::DtmfHighFreq::FREQ_1336 = 1336, telux::audio::DtmfHighFreq::FREQ_1477 = 1477, telux::audio::DtmfHighFreq::FREQ_1633 = 1633 }
 
enum  telux::audio::AmrwbpFrameFormat { telux::audio::AmrwbpFrameFormat::UNKNOWN = -1, telux::audio::AmrwbpFrameFormat::TRANSPORT_INTERFACE_FORMAT, telux::audio::AmrwbpFrameFormat::FILE_STORAGE_FORMAT }
 
enum  telux::audio::StopType { telux::audio::StopType::FORCE_STOP, telux::audio::StopType::STOP_AFTER_PLAY }
 

Detailed Description

This section contains APIs related to Audio Stream operation.


Data Structure Documentation

struct telux::audio::FormatParams

Frame format common parameters

struct telux::audio::AmrwbpParams

Frame format codec specific parameters

Data Fields

uint32_t bitWidth
 
AmrwbpFrameFormat frameFormat
 

Field Documentation

uint32_t telux::audio::AmrwbpParams::bitWidth

Bitwidth of Stream, Typical Values <16/24>.

AmrwbpFrameFormat telux::audio::AmrwbpParams::frameFormat
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
vector< Direction > voicePaths

Represent voice path direction for in call audio. TX for Uplink and RX for Downlink.>

FormatParams * formatParams
struct telux::audio::FormatInfo

Represents information about the audio format.

Data Fields
uint32_t sampleRate

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

ChannelTypeMask mask

parameter for configuration of channel type

AudioFormat format

Represents audio format

FormatParams * params

Represents codec specific parameters, like Frame Format

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

enable or disable mute on stream

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

struct telux::audio::DtmfTone

DTMF tone parameters

Data Fields
DtmfLowFreq lowFreq
DtmfHighFreq highFreq
StreamDirection direction
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::IVoiceListener

Listener class for getting notifications related to DTMF tone detection. The client needs to implement these methods as briefly as possible and avoid blocking calls in it. The methods in this class can be invoked from multiple different threads. Client needs to make sure that the implementation is thread-safe.

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

Public Member Functions

virtual void onDtmfToneDetection (DtmfTone dtmfTone)
 
virtual ~IVoiceListener ()
 

Constructor & Destructor Documentation

virtual telux::audio::IVoiceListener::~IVoiceListener ( )
virtual

Destructor of IVoiceListener

Member Function Documentation

virtual void telux::audio::IVoiceListener::onDtmfToneDetection ( DtmfTone  dtmfTone)
virtual

This function is called when a DTMF tone is detected in the voice stream

Parameters
[in]dtmfToneDTMF tone properties
Note
Eval: This is a new API and is being evaluated.It is subject to change and could break backwards compatibility.
class telux::audio::IPlayListener

Public Member Functions

virtual void onReadyForWrite ()
 
virtual void onPlayStopped ()
 
virtual ~IPlayListener ()
 

Constructor & Destructor Documentation

virtual telux::audio::IPlayListener::~IPlayListener ( )
virtual

Destructor of IPlayListener

Member Function Documentation

virtual void telux::audio::IPlayListener::onReadyForWrite ( )
virtual

This function is called when pipeline is ready to accept new buffer. It is applicable only for compressed audio format type where a client can write and queue buffers for playback.

Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual void telux::audio::IPlayListener::onPlayStopped ( )
virtual

This function is called when stopAudio() is called with StopType::STOP_AFTER_PLAY. It indicates that all the buffers that were present in the pipeline have been played.

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

Public Member Functions

virtual void onReadyForWrite ()
 
virtual ~ITranscodeListener ()
 

Constructor & Destructor Documentation

virtual telux::audio::ITranscodeListener::~ITranscodeListener ( )
virtual

Destructor of ITranscodeListener

Member Function Documentation

virtual void telux::audio::ITranscodeListener::onReadyForWrite ( )
virtual

This function is called when pipeline is ready to accept new buffer. It is applicable only for compressed audio format type where a client can write and queue buffers for transcoding.

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

Stream Buffer manages the buffer to be used for read and write operations on Audio Streams. For write operations, applications should request a stream buffer, populate it with the data and then pass it to the write operation and set the dataSize that is to be written to the stream. Similarly for read operations,the application should request a stream buffer and use that in the read operation. At the end of the read, the stream buffer will contain the data read. Once an operation (read/write) has completed, the stream buffer could be reused for a subsequent read/write operation, provided reset() API called on stream buffer between subsequent calls.

Public Member Functions

virtual size_t getMinSize ()=0
 
virtual size_t getMaxSize ()=0
 
virtual uint8_t * getRawBuffer ()=0
 
virtual uint32_t getDataSize ()=0
 
virtual void setDataSize (uint32_t size)=0
 
virtual telux::common::Status reset ()=0
 
virtual ~IAudioBuffer ()
 

Constructor & Destructor Documentation

virtual telux::audio::IAudioBuffer::~IAudioBuffer ( )
virtual

Member Function Documentation

virtual size_t telux::audio::IAudioBuffer::getMinSize ( )
pure virtual

Returns the minimum size (in bytes) of data that caller needs to read/write before calling a read/write operation on the stream.

Returns
minimum size
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual size_t telux::audio::IAudioBuffer::getMaxSize ( )
pure virtual

Returns the maximum size (in bytes) that the buffer can hold.

Returns
maximum size
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual uint8_t* telux::audio::IAudioBuffer::getRawBuffer ( )
pure virtual

Gets the raw buffer that IStreamBuffer manages. Application should write in between(include) of getMinSize() to getMaxSize() number of bytes in this buffer. Application is not responsible to free the raw buffer. It will be free'ed when the IStreamBuffer is destroyed.

Returns
raw buffer
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual uint32_t telux::audio::IAudioBuffer::getDataSize ( )
pure virtual

Gets the size (in bytes) of valid data present in the buffer.

Returns
size of valid data in the buffer
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual void telux::audio::IAudioBuffer::setDataSize ( uint32_t  size)
pure virtual

Sets the size (in bytes) of valid data present in the buffer.

Parameters
sizesize of valid data in the buffer
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::IAudioBuffer::reset ( )
pure virtual

Reset all state and data of the buffer. This is to be called when reusing the same buffer for multiple operations.

Returns
status Status of the operation
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
class telux::audio::IStreamBuffer

Public Member Functions

virtual ~IStreamBuffer ()
 
- Public Member Functions inherited from telux::audio::IAudioBuffer
virtual size_t getMinSize ()=0
 
virtual size_t getMaxSize ()=0
 
virtual uint8_t * getRawBuffer ()=0
 
virtual uint32_t getDataSize ()=0
 
virtual void setDataSize (uint32_t size)=0
 
virtual telux::common::Status reset ()=0
 
virtual ~IAudioBuffer ()
 

Constructor & Destructor Documentation

virtual telux::audio::IStreamBuffer::~IStreamBuffer ( )
virtual
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 createTranscoder (FormatInfo input, FormatInfo output, CreateTranscoderResponseCb callback)=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::createTranscoder ( FormatInfo  input,
FormatInfo  output,
CreateTranscoderResponseCb  callback 
)
pure virtual

Creates an instance of transcoder that can be used for transcoding operations. Each instance returned can be used for single transcoding operation. The instance can not be used for multiple transcoding operation.

Parameters
[in]inputconfiguration of input buffers that needs to be transcoded.
[in]outputconfiguration of transcoded output buffers.
[in]callbackcallback pointer to get the response of createTranscoder.
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
 
virtual telux::common::Status playDtmfTone (DtmfTone dtmfTone, uint16_t duration, uint16_t gain, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status stopDtmfTone (StreamDirection direction, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status registerListener (std::weak_ptr< IVoiceListener > listener, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status deRegisterListener (std::weak_ptr< IVoiceListener > listener)=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.
virtual telux::common::Status telux::audio::IAudioVoiceStream::playDtmfTone ( DtmfTone  dtmfTone,
uint16_t  duration,
uint16_t  gain,
telux::common::ResponseCallback  callback = nullptr 
)
pure virtual

Plays in-band DTMF tone on the active voice stream

Parameters
[in]dtmfToneDTMF tone properties [in] duration Duration (in milliseconds) for which the tone needs to be played. The constant infiniteDtmfDuration(=0xFFFF) represents infinite duration. [in] gain DTMF tone gain [in] callback callback to get the response of playDtmfTone.
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::stopDtmfTone ( StreamDirection  direction,
telux::common::ResponseCallback  callback = nullptr 
)
pure virtual

Stops the DTMF tone which is being played (i.e duration not expired) on the active voice stream

Parameters
[in]directionDirection associated with the DTMF tone @ [in] callback callback to get the response of stopDtmfTone.
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::registerListener ( std::weak_ptr< IVoiceListener listener,
telux::common::ResponseCallback  callback = nullptr 
)
pure virtual

Register a listener to get notified when a DTMF tone is detected in the active voice stream

Parameters
[in]listenerPointer of IVoiceListener object that processes the notification [in] callback callback to get the response of registerListener
Returns
Status of registerListener 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::deRegisterListener ( std::weak_ptr< IVoiceListener listener)
pure virtual

Remove a previously registered listener.

Parameters
[in]listenerPreviously registered IVoiceListener that needs to be removed
Returns
Status of deRegisterListener, 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 std::shared_ptr< IStreamBuffergetStreamBuffer ()=0
 
virtual telux::common::Status write (std::shared_ptr< IStreamBuffer > buffer, WriteResponseCb callback=nullptr)=0
 
virtual telux::common::Status stopAudio (StopType stopType, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status registerListener (std::weak_ptr< IPlayListener > listener)=0
 
virtual telux::common::Status deRegisterListener (std::weak_ptr< IPlayListener > listener)=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 std::shared_ptr<IStreamBuffer> telux::audio::IAudioPlayStream::getStreamBuffer ( )
pure virtual

Get an Audio StreamBuffer to be used for playback operations

Returns
an Audio Buffer or a nullptr in case of error
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::IAudioPlayStream::write ( std::shared_ptr< IStreamBuffer buffer,
WriteResponseCb  callback = nullptr 
)
pure virtual

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

Write in case of compressed audio format maintains a pipeline, if the callback returns with same number of bytes written as requested and no error occured, user can send next buffer. If the number of bytes returned are not equal to the requested write size, then need to resend the buffer again from the leftover offset after waiting for the () event.

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.
virtual telux::common::Status telux::audio::IAudioPlayStream::stopAudio ( StopType  stopType,
telux::common::ResponseCallback  callback = nullptr 
)
pure virtual

This API is to be used to stop playback. It is applicable only for compressed audio format playback.

Parameters
[in]callbackcallback to get the response of stopAudio.
[in]stopTypeit specifies type of stop for stopping audio playback.
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::IAudioPlayStream::registerListener ( std::weak_ptr< IPlayListener listener)
pure virtual

Register a listener to get notified for events of Play Stream

Parameters
[in]listenerPointer of IPlayListener object that processes the notification [in] callback callback to get the response of registerListener
Returns
Status of registerListener 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::IAudioPlayStream::deRegisterListener ( std::weak_ptr< IPlayListener listener)
pure virtual

Remove a previously registered listener.

Parameters
[in]listenerPreviously registered IPlayListener that needs to be removed
Returns
Status of deRegisterListener, 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 std::shared_ptr< IStreamBuffergetStreamBuffer ()=0
 
virtual telux::common::Status read (std::shared_ptr< IStreamBuffer > buffer, uint32_t bytesToRead, ReadResponseCb 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 std::shared_ptr<IStreamBuffer> telux::audio::IAudioCaptureStream::getStreamBuffer ( )
pure virtual

Get an Audio Stream Buffer to be used for capture operations

Returns
an Audio Buffer or nullptr in case of failure
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::IAudioCaptureStream::read ( std::shared_ptr< IStreamBuffer buffer,
uint32_t  bytesToRead,
ReadResponseCb  callback = nullptr 
)
pure virtual

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

Parameters
[in]bufferstream buffer for read.
[in]bytesToReadspecifying how many bytes to be read from stream.
[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.
class telux::audio::IAudioLoopbackStream

IAudioLoopbackStream represents audio loopback stream.

Public Member Functions

virtual telux::common::Status startLoopback (telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status stopLoopback (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::IAudioLoopbackStream::startLoopback ( telux::common::ResponseCallback  callback = nullptr)
pure virtual

Start loopback between source and sink devices

Parameters
[in]callbackcallback to get the response of start loopback.
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::IAudioLoopbackStream::stopLoopback ( telux::common::ResponseCallback  callback = nullptr)
pure virtual

Stop loopback between source and sink devices

Parameters
[in]callbackcallback to get the response of stop loopback.
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::IAudioToneGeneratorStream

IAudioToneGeneratorStream represents tone generator stream.

Public Member Functions

virtual telux::common::Status playTone (std::vector< uint16_t > freq, uint16_t duration, uint16_t gain, telux::common::ResponseCallback callback=nullptr)=0
 
virtual telux::common::Status stopTone (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::IAudioToneGeneratorStream::playTone ( std::vector< uint16_t >  freq,
uint16_t  duration,
uint16_t  gain,
telux::common::ResponseCallback  callback = nullptr 
)
pure virtual

Play a tone on sink devices. As the duartion expires, the generated tone terminates automatically.

Parameters
[in]freqAccepts the composition of frequencies (in Hz) to be played such as single tone or dual tone. Any additional frequencies provided will be ignored. [in] duration Duration (in milliseconds) for which the tone needs to be played. The constant infiniteToneDuration(=0xFFFF) represents infinte duration. [in] gain Tone Gain. [in] callback callback to get the response of play tone.
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::IAudioToneGeneratorStream::stopTone ( telux::common::ResponseCallback  callback = nullptr)
pure virtual

Stops the tone which is being played (i.e duration not expired) on the active Tone generator stream.

Parameters
[in]callbackcallback to get the response of stop tone.
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::CreateTranscoderResponseCb = typedef std::function<void( std::shared_ptr<ITranscoder> &transcoder, telux::common::ErrorCode error)>

This function is called with the response to createTranscoder API.

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

Parameters
[in]transcoderInterface pointer of transcoder.
[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.
using telux::audio::WriteResponseCb = typedef std::function<void(std::shared_ptr<IStreamBuffer> buffer, uint32_t bytesWritten, telux::common::ErrorCode error)>

This function is called with the response to IAudioPlayStream::write().

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

Parameters
[in]bufferBuffer that was used for the write operation. Application could call IStreamBuffer::reset() and reuse this buffer for subsequent write operations on the same stream.
[in]bytesWrittenReturn how many bytes are written to the stream.
[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::ReadResponseCb = typedef std::function<void(std::shared_ptr<IStreamBuffer> buffer, telux::common::ErrorCode error)>

This function is called with the response to IAudioCaptureStream::read().

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

Parameters
[in]bufferBuffer that was used to capture the data from the read operation. Applications could call IStreamBuffer::reset() and reuse this buffer for subsequent read operations on the same stream. Also buffer.getDataSize() will represent the number of bytes read.
[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 Voice Direction RX (Sink), Tx (Source)

Enumerator
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

LOOPBACK 

Loopback, Provides loopback between source and sink devices

TONE_GENERATOR 

Tone Generator, Generates tone on sink device

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 

16 bit signed PCM format

AMRNB 

AMRNB format

AMRWB 

AMRWB format

AMRWB_PLUS 

AMRWB+ format

Represents the possible lower frequencies(in Hz) in a standard DTMF tone

Enumerator
FREQ_697 
FREQ_770 
FREQ_852 
FREQ_941 

Represents the possible higher frequencies(in Hz) in a standard DTMF tone

Enumerator
FREQ_1209 
FREQ_1336 
FREQ_1477 
FREQ_1633 

Representative of type of frame structure. Typical transport interface or file storage.

Enumerator
UNKNOWN 

Unknown format

TRANSPORT_INTERFACE_FORMAT 
FILE_STORAGE_FORMAT 

Represents type of stop for compressed audio format playback. Audio playback can be stopped in two ways force stop and after playing all buffers in the pipeline.

Enumerator
FORCE_STOP 
STOP_AFTER_PLAY 

Stop Playing Immediately and clear buffer pipeline