Telematics SDK - Interface Specification  v1.26.3
telux::audio Namespace Reference

Data Structures

struct  AmrwbpParams
 
class  AudioFactory
 AudioFactory allows creation of audio manager. More...
 
struct  ChannelVolume
 
struct  DtmfTone
 
struct  FormatInfo
 
struct  FormatParams
 
class  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  IAudioCaptureStream
 IAudioCaptureStream represents single audio capture stream. More...
 
class  IAudioDevice
 Audio device and it's characteristics like Direction (Sink or Source), type. More...
 
class  IAudioLoopbackStream
 IAudioLoopbackStream represents audio loopback stream. More...
 
class  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  IAudioPlayStream
 IAudioPlayStream represents single audio playback stream. More...
 
class  IAudioStream
 IAudioStream represents single audio stream with base properties. More...
 
class  IAudioToneGeneratorStream
 IAudioToneGeneratorStream represents tone generator stream. More...
 
class  IAudioVoiceStream
 IAudioVoiceStream represents single voice stream. More...
 
class  IPlayListener
 
class  IStreamBuffer
 
class  ITranscodeListener
 
class  ITranscoder
 ITranscoder is used to convert one audio format to another audio format using the transcoding operation. More...
 
class  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...
 
struct  StreamBuffer
 
struct  StreamConfig
 
struct  StreamMute
 
struct  StreamVolume
 

Typedefs

using ChannelTypeMask = int
 
using GetDevicesResponseCb = std::function< void(std::vector< std::shared_ptr< IAudioDevice >> devices, telux::common::ErrorCode error)>
 
using GetStreamTypesResponseCb = std::function< void(std::vector< StreamType > streamTypes, telux::common::ErrorCode error)>
 
using CreateStreamResponseCb = std::function< void(std::shared_ptr< IAudioStream > &stream, telux::common::ErrorCode error)>
 
using CreateTranscoderResponseCb = std::function< void(std::shared_ptr< ITranscoder > &transcoder, telux::common::ErrorCode error)>
 
using DeleteStreamResponseCb = std::function< void(telux::common::ErrorCode error)>
 
using GetStreamDeviceResponseCb = std::function< void(std::vector< DeviceType > devices, telux::common::ErrorCode error)>
 
using GetStreamVolumeResponseCb = std::function< void(StreamVolume volume, telux::common::ErrorCode error)>
 
using GetStreamMuteResponseCb = std::function< void(StreamMute mute, telux::common::ErrorCode error)>
 
using WriteResponseCb = std::function< void(std::shared_ptr< IStreamBuffer > buffer, uint32_t bytesWritten, telux::common::ErrorCode error)>
 
using ReadResponseCb = std::function< void(std::shared_ptr< IStreamBuffer > buffer, telux::common::ErrorCode error)>
 
using TranscoderReadResponseCb = std::function< void(std::shared_ptr< IAudioBuffer > buffer, uint32_t isLastBuffer, telux::common::ErrorCode error)>
 
using TranscoderWriteResponseCb = std::function< void(std::shared_ptr< IAudioBuffer > buffer, uint32_t bytesWritten, telux::common::ErrorCode error)>
 

Enumerations

enum  DeviceType { DEVICE_TYPE_NONE = -1, DEVICE_TYPE_SPEAKER = 1, DEVICE_TYPE_MIC = 257 }
 
enum  DeviceDirection { DeviceDirection::NONE = -1, DeviceDirection::RX = 1, DeviceDirection::TX = 2 }
 
enum  Direction { Direction::RX = 1, Direction::TX = 2 }
 
enum  StreamType {
  StreamType::NONE = -1, StreamType::VOICE_CALL = 1, StreamType::PLAY = 2, StreamType::CAPTURE = 3,
  StreamType::LOOPBACK = 4, StreamType::TONE_GENERATOR = 5
}
 
enum  StreamDirection { StreamDirection::NONE = -1, StreamDirection::RX = 1, StreamDirection::TX = 2 }
 
enum  ChannelType { LEFT = (1 << 0), RIGHT = (1 << 1) }
 
enum  AudioFormat {
  AudioFormat::UNKNOWN = -1, AudioFormat::PCM_16BIT_SIGNED = 1, AudioFormat::AMRNB = 20, AudioFormat::AMRWB,
  AudioFormat::AMRWB_PLUS
}
 
enum  DtmfLowFreq { DtmfLowFreq::FREQ_697 = 697, DtmfLowFreq::FREQ_770 = 770, DtmfLowFreq::FREQ_852 = 852, DtmfLowFreq::FREQ_941 = 941 }
 
enum  DtmfHighFreq { DtmfHighFreq::FREQ_1209 = 1209, DtmfHighFreq::FREQ_1336 = 1336, DtmfHighFreq::FREQ_1477 = 1477, DtmfHighFreq::FREQ_1633 = 1633 }
 
enum  AmrwbpFrameFormat { AmrwbpFrameFormat::UNKNOWN = -1, AmrwbpFrameFormat::TRANSPORT_INTERFACE_FORMAT, AmrwbpFrameFormat::FILE_STORAGE_FORMAT }
 
enum  StopType { StopType::FORCE_STOP, StopType::STOP_AFTER_PLAY }
 

Variables

const uint16_t INFINITE_DTMF_DURATION = 0xFFFF
 
const uint16_t INFINITE_TONE_DURATION = 0xFFFF
 

Typedef Documentation

using telux::audio::TranscoderReadResponseCb = typedef std::function<void(std::shared_ptr<IAudioBuffer> buffer, uint32_t isLastBuffer, telux::common::ErrorCode error)>

This function is called with the response to ITranscoder::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 transcode read operation. Applications could call IAudioBuffer::reset() and reuse this buffer for subsequent read operations on the same transcoder instance. Also buffer.getDataSize() will represent the number of bytes contained in a buffer.
[in]isLastBufferrepresents whether the transcoded buffer is last buffer or not. Once the last buffer is received no more further read operations are required.
[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::TranscoderWriteResponseCb = typedef std::function<void(std::shared_ptr<IAudioBuffer> buffer, uint32_t bytesWritten, telux::common::ErrorCode error)>

This function is called with the response to ITranscoder::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 for transcoding. Application could call IAudioBuffer::reset() and reuse this buffer for subsequent write operations on the same transcoder instance.
[in]bytesWrittenReturn how many bytes are sent for transcoding.
[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.

Variable Documentation

const uint16_t telux::audio::INFINITE_DTMF_DURATION = 0xFFFF

Duration to play DTMF tone for infinite time

const uint16_t telux::audio::INFINITE_TONE_DURATION = 0xFFFF