Telematics SDK - API Reference
v1.51.0
|
Data Structures | |
struct | telux::audio::ChannelVolume |
struct | telux::audio::StreamVolume |
struct | telux::audio::StreamMute |
struct | telux::audio::StreamBuffer |
struct | telux::audio::DtmfTone |
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::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::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::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::Direction { telux::audio::Direction::RX = 1, telux::audio::Direction::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::StopType { telux::audio::StopType::FORCE_STOP, telux::audio::StopType::STOP_AFTER_PLAY } |
This section contains APIs related to Audio Stream operation.
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 |
struct telux::audio::DtmfTone |
DTMF tone parameters
Data Fields | ||
---|---|---|
DtmfLowFreq | lowFreq |
Lower frequency associated with DTMF tone |
DtmfHighFreq | highFreq |
Higher frequency associated with DTMF tone |
StreamDirection | direction |
Direction associated with DTMF tone |
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.
Public Member Functions | |
virtual void | onDtmfToneDetection (DtmfTone dtmfTone) |
virtual | ~IVoiceListener () |
|
virtual |
Destructor of IVoiceListener
|
virtual |
This function is called when a DTMF tone is detected in the voice stream
[in] | dtmfTone | DTMF tone properties |
class telux::audio::IPlayListener |
Public Member Functions | |
virtual void | onReadyForWrite () |
virtual void | onPlayStopped () |
virtual | ~IPlayListener () |
|
virtual |
Destructor of IPlayListener
|
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.
|
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.
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 () |
|
virtual |
|
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.
|
pure virtual |
Returns the maximum size (in bytes) that the buffer can hold.
|
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.
|
pure virtual |
Gets the size (in bytes) of valid data present in the buffer.
|
pure virtual |
Sets the size (in bytes) of valid data present in the buffer.
size | size of valid data in the buffer |
|
pure virtual |
Reset all state and data of the buffer. This is to be called when reusing the same buffer for multiple operations.
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 () |
|
virtual |
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 |
virtual | ~IAudioStream () |
|
virtual |
|
pure virtual |
Get the stream type like VOICE, PLAY, CAPTURE
|
pure virtual |
Set Device for audio stream. For VOICE_CALL, IAudioVoiceStream::startAudio API is required to be called on audio stream object for this API to take effect.
[in] | devices | Devices list. |
[in] | callback | callback to get the response of setDevice. |
|
pure virtual |
Get Device for audio stream
[in] | callback | callback to get the response of getDevice |
|
pure virtual |
Set Volume of audio stream. Application needs to provide direction of the stream. Currently TX direction of VOICE_CALL is not supported.
[in] | volume | volume setting per channel for direction. |
[in] | callback | callback to get the response of setVolume. |
|
pure virtual |
Get Volume of audio stream. Application needs to provide direction of the stream. Currently TX direction of VOICE_CALL is not supported.
[in] | dir | Stream Direction to query volume details. |
[in] | callback | callback to get the response of getVolume. |
|
pure virtual |
Request to mute/unmute audio stream. For VOICE_CALL, IAudioVoiceStream::startAudio API is required to be called on audio stream object for this API to take effect.
[in] | mute | mute setting for direction. |
[in] | callback | callback to know the status of the request. |
|
pure virtual |
Get the mute status of the 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.
|
virtual |
|
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. |
|
pure virtual |
Plays in-band DTMF tone on the active voice stream. This API supports DTMF tone playback on local device on the RX path, for playing DTMF on the TX path so that it is heard on far end use telux::tel::ICall::startDtmfTone API.
[in] | dtmfTone | DTMF 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. |
|
pure virtual |
Stops the DTMF tone which is being played (i.e duration not expired) on the active voice stream
[in] | direction | Direction associated with the DTMF tone |
[in] | callback | callback to get the response of stopDtmfTone. |
|
pure virtual |
Register a listener to get notified when a DTMF tone is detected in the active voice stream
[in] | listener | Pointer of IVoiceListener object that processes the notification |
[in] | callback | callback to get the response of registerListener |
|
pure virtual |
Remove a previously registered listener.
[in] | listener | Previously registered IVoiceListener that needs to be removed |
class telux::audio::IAudioPlayStream |
IAudioPlayStream represents single audio playback stream.
|
virtual |
|
pure virtual |
Get an Audio StreamBuffer to be used for playback operations
|
pure virtual |
Write Samples/Frames 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 IPlayListener::onReadyForWrite() event. Once the last buffer is sent and the playback operation is complete, delete the playback stream to avoid receiving silent packets on RX path.
[in] | buffer | stream buffer for write. |
[in] | callback | callback to get the response of write. |
|
pure virtual |
This API is to be used to stop playback. It is applicable only for compressed audio format playback.
[in] | callback | callback to get the response of stopAudio. |
[in] | stopType | it specifies type of stop for stopping audio playback. |
|
pure virtual |
Register a listener to get notified for events of Play Stream
[in] | listener | Pointer of IPlayListener object that processes the notification [in] callback callback to get the response of registerListener |
|
pure virtual |
Remove a previously registered listener.
[in] | listener | Previously registered IPlayListener that needs to be removed |
class telux::audio::IAudioCaptureStream |
IAudioCaptureStream represents single audio capture stream.
|
virtual |
|
pure virtual |
Get an Audio Stream Buffer to be used for capture operations
|
pure virtual |
Read Samples from audio stream. First read starts capture operation.
[in] | buffer | stream buffer for read. |
[in] | bytesToRead | specifying how many bytes to be read from stream. |
[in] | callback | callback to get the response of read. |
class telux::audio::IAudioLoopbackStream |
IAudioLoopbackStream represents audio loopback stream.
|
virtual |
|
pure virtual |
Start loopback between source and sink devices
[in] | callback | callback to get the response of start loopback. |
|
pure virtual |
Stop loopback between source and sink devices
[in] | callback | callback to get the response of stop loopback. |
class telux::audio::IAudioToneGeneratorStream |
IAudioToneGeneratorStream represents tone generator stream.
|
virtual |
|
pure virtual |
Play a tone on sink devices. As the duartion expires, the generated tone terminates automatically.
[in] | freq | Accepts 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. |
|
pure virtual |
Stops the tone which is being played (i.e duration not expired) on the active Tone generator stream.
[in] | callback | callback to get the response of stop tone. |
using telux::audio::ChannelTypeMask = typedef int |
Represent Stream's consolidated lists of Channel presence
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 |
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.
[in] | buffer | Buffer 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] | bytesWritten | Return how many bytes are written to the stream. |
[in] | error | Return code which indicates whether the operation succeeded or not. ErrorCode |
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.
[in] | buffer | Buffer 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] | error | Return code which indicates whether the operation succeeded or not. ErrorCode |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
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 Playing Immediately and clear buffer pipeline |
STOP_AFTER_PLAY |
Stop Play once after all buffers in pipeline are played |