Telematics SDK - API Reference
v1.64.0
|
Data Structures | |
struct | telux::audio::FormatParams |
struct | telux::audio::AmrwbpParams |
struct | telux::audio::StreamConfig |
struct | telux::audio::FormatInfo |
class | telux::audio::IAudioListener |
class | telux::audio::IAudioManager |
class | telux::audio::IAudioDevice |
Typedefs | |
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::GetCalInitStatusResponseCb = std::function< void(CalibrationInitStatus calInitStatus, telux::common::ErrorCode error)> |
This section contains APIs related to Audio Manager operation.
struct telux::audio::FormatParams |
Represents the base class for compressed audio formats.
struct telux::audio::AmrwbpParams |
Specifies the details of the adaptive multirate wide band format frame.
Data Fields | |
uint32_t | bitWidth |
AmrwbpFrameFormat | frameFormat |
uint32_t telux::audio::AmrwbpParams::bitWidth |
Bit width of the stream (16 or 24)
AmrwbpFrameFormat telux::audio::AmrwbpParams::frameFormat |
Refer to AmrwbpFrameFormat
struct telux::audio::StreamConfig |
Defines the parameters when creating an audio stream. The required parameters for a given use-case are as follows:
For regular voicecall: type, slotId, channelTypeMask, format, deviceTypes For hpcm-voicecall: type, slotId, channelTypeMask, format, deviceTypes, enableHpcm For ecall: type, slotId, channelTypeMask, format, deviceTypes, ecnrMode
For playback: type, sampleRate, channelTypeMask, format, deviceTypes For incall-playback and hpcm-playback: type, sampleRate, channelTypeMask, format, deviceTypes, voicePaths
For capture: type, sampleRate, channelTypeMask, format, deviceTypes For incall-capture and hpcm-capture: type, sampleRate, channelTypeMask, format, deviceTypes, voicePaths
For loopback: type, sampleRate, channelTypeMask, format, deviceTypes
For tone-generation: type, sampleRate, channelTypeMask, format, deviceTypes
Data Fields | ||
---|---|---|
StreamType | type |
StreamType - defines purpose of the stream |
int | modemSubId |
|
SlotId | slotId |
SlotId - specifies the slot ID where the UICC card is inserted |
uint32_t | sampleRate |
Sample rate in Hz. Typical values are 8k, 16k, 32k and 48k. For Bluetooth use-cases, supported values are 8k and 16k |
ChannelTypeMask | channelTypeMask |
ChannelTypeMask - defines audio channels to use |
AudioFormat | format |
AudioFormat - defines audio format |
vector< DeviceType > | deviceTypes |
Defines the list of audio devices DeviceType to use for this stream. For StreamType::PLAY and StreamType::TONE_GENERATOR, a single sink device should be specified. For StreamType::CAPTURE, a single source device should be specified. For StreamType::VOICE_CALL and StreamType::LOOPBACK, both sink and source should be specified with sink as the first device and source as the second. |
vector< Direction > | voicePaths |
For an in-call and hpcm audio usecase, this represents the voice path direction Direction |
FormatParams * | formatParams |
FormatParams - defines compressed playback format |
EcnrMode | ecnrMode |
EcnrMode - true to enable ECNR on an ecall |
bool | enableHpcm |
True - if voice call is used with HPCM, false otherwise |
struct telux::audio::FormatInfo |
Specifies the parameters when setting up streams for transcoding.
Data Fields | ||
---|---|---|
uint32_t | sampleRate |
Sample rate in Hz, typical values 8k/16k/32k/48k Sample rate is a dummy paramter for voice stream and compressed playback |
ChannelTypeMask | mask |
Refer to ChannelTypeMask |
AudioFormat | format |
Refer to AudioFormat |
FormatParams * | params |
Refer to FormatParams |
class telux::audio::IAudioListener |
Listener for the audio service availability. Refer to telux::common::IServiceStatusListener for details.
Public Member Functions | |
virtual | ~IAudioListener () |
![]() | |
virtual void | onServiceStatusChange (ServiceStatus status) |
virtual | ~IServiceStatusListener () |
|
virtual |
Destructor of IAudioListener.
class telux::audio::IAudioManager |
Provides the APIs to discover the supported audio devices, create streams, and subscribe for audio service status updates.
|
virtual |
Destructor of the IAudioManager.
|
pure virtual |
Checks if the audio service is ready for use.
|
pure virtual |
Gets the audio service status.
|
pure virtual |
Suggests when the audio service is ready.
|
pure virtual |
Gets the list of the supported audio devices.
[in] | callback | Mandatory, callback that will receive the list |
|
pure virtual |
Gets the list of the supported stream types.
[in] | callback | Mandatory, callback that will receive the list |
|
pure virtual |
Creates an audio stream with the parameters provided.
On platforms with access control enabled, the caller must have TELUX_AUDIO_VOICE, TELUX_AUDIO_PLAY, TELUX_AUDIO_CAPTURE, or TELUX_AUDIO_FACTORY_TEST permission to invoke this method successfully.
[in] | streamConfig | Parameters of the stream |
[in] | callback | Mandatory, invoked to pass the stream created |
|
pure virtual |
Set up the transcoder with the given parameters.
Transcoder instance is obtained in CreateTranscoderResponseCb. It can be used only for a single transcoding operation.
On platforms with access control enabled, the caller must have TELUX_AUDIO_TRANSCODE permission to invoke this method successfully.
[in] | input | Details of the input to transcode |
[in] | output | Details of the transcoded output required |
[in] | callback | Mandatory, invoked to pass the transcoder instance |
|
pure virtual |
Deletes the stream created with createStream(). It closes the stream and releases all resources allocated for this stream.
On platforms with access control enabled, the caller must have TELUX_AUDIO_VOICE, TELUX_AUDIO_PLAY, TELUX_AUDIO_CAPTURE, or TELUX_AUDIO_FACTORY_TEST permission to invoke this method successfully.
[in] | stream | Stream to delete |
[in] | callback | Optional, invoked to pass the result of the stream deletion |
|
pure virtual |
Registers the given listener to get notified when the audio service status changes. The method IAudioListener::onServiceStatusChange() is invoked to notify of the new status.
[in] | listener | Invoked to pass the new service status |
|
pure virtual |
Unregisters the given listener registered previously with registerListener().
[in] | listener | Listener to unregister |
|
pure virtual |
Gets the current initialization status of the audio calibration database (ACDB). This status is obtained in the GetCalInitStatusResponseCb callback.
[in] | callback | Mandatory, invoked to pass the initialization status |
class telux::audio::IAudioDevice |
Represents an audio device. Used in conjunction with GetDevicesResponseCb.
Public Member Functions | |
virtual DeviceType | getType ()=0 |
virtual DeviceDirection | getDirection ()=0 |
virtual | ~IAudioDevice () |
|
virtual |
Destructor of the IAudioDevice.
|
pure virtual |
Gets the type of the audio device.
|
pure virtual |
Gets the direction of the audio device.
using telux::audio::GetDevicesResponseCb = typedef std::function<void(std::vector< std::shared_ptr<IAudioDevice>> devices, telux::common::ErrorCode error)> |
Invoked to pass the list of the supported audio devices. Used in conjunction with IAudioManager::getDevices().
[in] | devices | List of the IAudioDevice devices |
[in] | error | telux::common::ErrorCode::SUCCESS if the list is fetched successfully, otherwise, an appropriate error code |
using telux::audio::GetStreamTypesResponseCb = typedef std::function<void(std::vector<StreamType> streamTypes, telux::common::ErrorCode error)> |
Invoked to pass the list of the supported audio stream types. Used in conjunction with IAudioManager::getStreamTypes().
[in] | streamTypes | List of the StreamType types |
[in] | error | telux::common::ErrorCode::SUCCESS if the list is fetched successfully, otherwise, an appropriate error code |
using telux::audio::CreateStreamResponseCb = typedef std::function<void(std::shared_ptr<IAudioStream> &stream, telux::common::ErrorCode error)> |
Invoked to pass the instance of the audio stream created. Used in conjunction with IAudioManager::createStream().
Passed stream should be type casted before using it, according to the StreamType::* type that was requested while creating it.
For StreamType::VOICE_CALL type cast to IAudioManager::IAudioVoiceStream. For StreamType::CAPTURE type cast to IAudioManager::IAudioCaptureStream. For StreamType::PLAY cast to IAudioManager::IAudioPlayStream. For StreamType::LOOPBACK cast to IAudioManager::IAudioLoopbackStream. For StreamType::TONE_GENERATOR cast to IAudioManager::IAudioToneGeneratorStream.
[in] | stream | Audio stream created or nullptr if creation failed |
[in] | error | telux::common::ErrorCode::SUCCESS if the stream is created successfully, otherwise, an appropriate error code |
using telux::audio::CreateTranscoderResponseCb = typedef std::function<void(std::shared_ptr<ITranscoder> &transcoder, telux::common::ErrorCode error)> |
Invoked to pass the instance of the ITranscoder created. Used in conjunction with IAudioManager::createTranscoder().
[in] | transcoder | ITranscoder instance or nullptr if transcoder can't be setup |
[in] | error | telux::common::ErrorCode::SUCCESS if the transcoder is set up successfully, otherwise, an appropriate error code |
using telux::audio::DeleteStreamResponseCb = typedef std::function<void(telux::common::ErrorCode error)> |
Invoked to confirm if the stream is deleted or not. Used in conjunction with IAudioManager::deleteStream().
[in] | error | telux::common::ErrorCode::SUCCESS if the stream is deleted, otherwise, an appropriate error code |
using telux::audio::GetCalInitStatusResponseCb = typedef std::function<void(CalibrationInitStatus calInitStatus, telux::common::ErrorCode error)> |
Invoked to pass the audio calibration database (ACDB) initialization status. Used in conjunction with IAudioManager::getCalibrationInitStatus().
[in] | calInitStatus | CalibrationInitStatus::INIT_SUCCESS if the ACDB is initialized successfully, CalibrationInitStatus::INIT_FAILED if initialization failed |
[in] | error | telux::common::ErrorCode::SUCCESS if the status is is fetched successfully, otherwise, an appropriate error code |
Represents an audio device. Each device is mapped to its corresponding platform specific audio device type. This mapping is done in tel.conf file by the system integrator. Refer to README specified for the tel.conf file for details on the mapping of the DeviceType to a specific device on the HW platform.
|
strong |
|
strong |
Defines the type of the audio stream and the type's purpose.
Enumerator | |
---|---|
NONE |
Default type (invalid) |
VOICE_CALL |
Used for audio over a cellular network |
PLAY |
Used for playing audio, for example playing music and notifications |
CAPTURE |
Used for capturing audio, for example recording sound using a mic |
LOOPBACK |
Used for generating audio from a DeviceDirection::RX device, which is intended to be captured back by a DeviceDirection::TX device |
TONE_GENERATOR |
Used for single tone and DTMF tone generation |
|
strong |
|
strong |
Defines the properties of the audio data for compressed playback and transcoding.
|
strong |
|
strong |