Telematics SDK - API Reference
v1.55.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, typically 16 or 24
AmrwbpFrameFormat telux::audio::AmrwbpParams::frameFormat |
Refer to AmrwbpFrameFormat
struct telux::audio::StreamConfig |
Defines the parameters when creating an audio stream.
Data Fields | ||
---|---|---|
StreamType | type |
Refer to StreamType |
int | modemSubId |
|
SlotId | slotId |
SlotId – specifies the slot ID where the UICC card is inserted. Used in conjuction with StreamType::VOICE_CALL only |
uint32_t | sampleRate |
Sample rate in Hz, typical values 8k/16k/32k/48k |
ChannelTypeMask | channelTypeMask |
Refer to ChannelTypeMask |
AudioFormat | format |
Refer to AudioFormat |
vector< DeviceType > | deviceTypes |
Defines the list of audio devices DeviceType to use for this stream |
vector< Direction > | voicePaths |
For an in-call audio usecase, this represents the voice path direction Direction |
FormatParams * | formatParams |
Refer to FormatParams |
EcnrMode | ecnrMode |
Refer to EcnrMode |
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 |
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 () |
Public Member Functions inherited from telux::common::IServiceStatusListener | |
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 | 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 | 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. Below table provides default mapping of devices on a QTI's reference platform.
Applicable for SA515M, SA415M, SA410M, SA2150P based software products:
Telsdk device type | Direction | Mapped HAL device |
---|---|---|
DEVICE_TYPE_NONE | N/A | AUDIO_DEVICE_NONE |
DEVICE_TYPE_SPEAKER | RX | AUDIO_DEVICE_OUT_SPEAKER |
DEVICE_TYPE_SPEAKER_2 | RX | AUDIO_DEVICE_OUT_EARPIECE |
DEVICE_TYPE_SPEAKER_3 | RX | AUDIO_DEVICE_OUT_WIRED_HEADSET |
DEVICE_TYPE_BT_SCO_SPEAKER | RX | AUDIO_DEVICE_NONE |
DEVICE_TYPE_PROXY_SPEAKER | RX | AUDIO_DEVICE_OUT_PROXY |
DEVICE_TYPE_MIC | TX | AUDIO_DEVICE_IN_BACK_MIC |
DEVICE_TYPE_MIC_2 | TX | AUDIO_DEVICE_IN_BUILTIN_MIC |
DEVICE_TYPE_MIC_3 | TX | AUDIO_DEVICE_IN_WIRED_HEADSET |
DEVICE_TYPE_BT_SCO_MIC | TX | AUDIO_DEVICE_NONE |
DEVICE_TYPE_PROXY_MIC | TX | AUDIO_DEVICE_IN_PROXY |
Applicable for SA525M based software products:
Telsdk device type | Direction | Mapped PAL device |
---|---|---|
DEVICE_TYPE_NONE | N/A | PAL_DEVICE_NONE |
DEVICE_TYPE_SPEAKER | RX | PAL_DEVICE_OUT_SPEAKER |
DEVICE_TYPE_SPEAKER_2 | RX | PAL_DEVICE_OUT_HANDSET |
DEVICE_TYPE_SPEAKER_3 | RX | PAL_DEVICE_OUT_WIRED_HEADSET |
DEVICE_TYPE_BT_SCO_SPEAKER | RX | PAL_DEVICE_OUT_BLUETOOTH_SCO |
DEVICE_TYPE_PROXY_SPEAKER | RX | PAL_DEVICE_OUT_PROXY |
DEVICE_TYPE_MIC | TX | PAL_DEVICE_IN_SPEAKER_MIC |
DEVICE_TYPE_MIC_2 | TX | PAL_DEVICE_IN_HANDSET_MIC |
DEVICE_TYPE_MIC_3 | TX | PAL_DEVICE_IN_WIRED_HEADSET |
DEVICE_TYPE_BT_SCO_MIC | TX | PAL_DEVICE_IN_BLUETOOTH_SCO_HEADSET |
DEVICE_TYPE_PROXY_MIC | TX | PAL_DEVICE_IN_PROXY |
|
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 |