Telematics SDK - Interface Specification
v1.16.0
|
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 } |
This section contains APIs related to Audio Stream operation.
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 |
class telux::audio::AudioFactory |
AudioFactory allows creation of audio manager.
Public Member Functions | |
std::shared_ptr< IAudioManager > | getAudioManager () |
~AudioFactory () | |
Static Public Member Functions | |
static AudioFactory & | getInstance () |
telux::audio::AudioFactory::~AudioFactory | ( | ) |
|
static |
Get Audio Factory instance.
std::shared_ptr<IAudioManager> telux::audio::AudioFactory::getAudioManager | ( | ) |
Get instance of audio manager.
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 |
|
pure virtual |
Checks the status of audio subsystems and returns the result.
|
pure virtual |
Wait for Audio subsystem to be ready.
|
pure virtual |
Get the list of supported audio devices, which are currently supported in the audio subsystem
[in] | callback | callback pointer to get the response of getDevices. |
|
pure virtual |
Get the list of supported audio streams types, which are currently supported in the audio subsystem
[in] | callback | callback pointer to get the response of getStreamTypes. |
|
pure virtual |
Creates the stream for audio operation
[in] | streamConfig | stream configuration. |
[in] | callback | callback pointer to get the response of createStream. |
|
pure virtual |
Deletes the specified stream which was created before
[in] | stream | reference to stream to be deleted. |
[in] | callback | callback pointer to get the response of deleteStream. |
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 |
|
pure virtual |
Get the type of Device (i.e SPEAKER, MIC etc)
|
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)
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 |
|
pure virtual |
Get the stream type like VOICE, PLAY, CAPTURE
|
pure virtual |
Set Device of audio stream
[in] | devices | Devices list. |
[in] | callback | callback to get the response of setDevice. |
|
pure virtual |
Get Device of audio stream
[in] | callback | callback to get the response of getDevice |
|
pure virtual |
Set Volume of audio stream
[in] | volume | volume setting per channel for direction. |
[in] | callback | callback to get the response of setVolume. |
|
pure virtual |
Get Volume of audio stream
[in] | dir | Stream Direction to query volume details. |
[in] | callback | callback to get the response of getVolume. |
|
pure virtual |
Set Mute of audio stream
[in] | mute | mute setting for direction. |
[in] | callback | callback to know the status of the request. |
|
pure virtual |
Get Mute of audio stream
[in] | dir | Stream Direction to query mute details. |
[in] | callback | callback to get the response of getMute. |
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 |
|
pure virtual |
Starts audio stream
[in] | callback | callback to get the response of startAudio. |
|
pure virtual |
Stops audio stream
[in] | callback | callback to get the response of stopAudio. |
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 |
|
pure virtual |
Write Samples to audio stream. First write starts playback operation.
[in] | buffer | stream buffer for write. |
[in] | callback | callback to get the response of write. |
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 |
|
pure virtual |
Read Samples from audio stream. First read starts capture operation.
[in] | buffer | stream buffer for read. |
[in] | callback | callback to get the response of read. |
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.
[in] | devices | Devices list. |
[in] | error | Return code which indicates whether the operation succeeded or not. ErrorCode |
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.
[in] | streamTypes | Stream type list. |
[in] | error | Return code which indicates whether the operation succeeded or not. ErrorCode |
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.
[in] | stream | Interface pointer of Stream created. VOICE_CALL - Provides IAudioVoiceStream pointer PLAY - Provides IAudioPlayStream pointer CAPTURE - Provides IAudioCaptureStream pointer |
[in] | error | Return code which indicates whether the operation succeeded or not. ErrorCode |
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.
[in] | error | Return code which indicates whether the operation succeeded or not. ErrorCode |
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.
[in] | devices | Devices list. |
[in] | error | Return code which indicates whether the operation succeeded or not. ErrorCode |
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.
[in] | volume | stream volume details. |
[in] | error | Return code which indicates whether the operation succeeded or not. ErrorCode |
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.
[in] | mute | stream mute details. |
[in] | error | Return code which indicates whether the operation succeeded or not. ErrorCode |
|
strong |
|
strong |
|
strong |
|
strong |