Telematics SDK - Interface Specification  v1.18.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
 
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::IStreamBuffer
 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::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)>
 
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::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 }
 
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 }
 

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

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::IStreamBuffer

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 ~IStreamBuffer ()
 

Constructor & Destructor Documentation

virtual telux::audio::IStreamBuffer::~IStreamBuffer ( )
virtual

Member Function Documentation

virtual size_t telux::audio::IStreamBuffer::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::IStreamBuffer::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::IStreamBuffer::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::IStreamBuffer::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::IStreamBuffer::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::IStreamBuffer::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::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
 
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
< IStreamBuffer
getStreamBuffer ()=0
 
virtual telux::common::Status write (std::shared_ptr< IStreamBuffer > buffer, WriteResponseCb 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::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.

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 std::shared_ptr
< IStreamBuffer
getStreamBuffer ()=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.

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

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