Telematics SDK - API Reference
v1.64.0
|
Data Structures | |
struct | telux::audio::RepeatInfo |
struct | telux::audio::PlaybackFile |
class | telux::audio::IPlayListListener |
class | telux::audio::IAudioPlayer |
Enumerations | |
enum | telux::audio::RepeatType { telux::audio::RepeatType::COUNT, telux::audio::RepeatType::INDEFINITELY, telux::audio::RepeatType::SKIP } |
This section contains audio player APIs.
struct telux::audio::RepeatInfo |
Defines number of times a file should be played.
Data Fields | ||
---|---|---|
RepeatType | type |
Please refer RepeatType for details |
uint32_t | count |
When using RepeatType::REPEAT_TYPE_COUNT, defines number of times a file should be played |
struct telux::audio::PlaybackFile |
Specifies files to play and how to play.
Data Fields | ||
---|---|---|
string | absoluteFilePath |
Absolute path of the file |
RepeatInfo | repeatInfo |
Defines how a file should be played |
class telux::audio::IPlayListListener |
Receives status of the playback.
Public Member Functions | |
virtual void | onPlaybackStarted () |
virtual void | onPlaybackStopped () |
virtual void | onError (telux::common::ErrorCode error, std::string file) |
virtual void | onFilePlayed (std::string file) |
virtual void | onPlaybackFinished () |
virtual | ~IPlayListListener () |
|
virtual |
Destructor of IPlayListListener.
|
virtual |
Invoked when playback is started as a response to explicitly calling IAudioPlayer::startPlayback().
|
virtual |
Invoked whenever playback is stopped as a response to explicitly calling IAudioPlayer::stopPlayback() or when playback is stopped due to an error.
This API will not be invoked if all the files in the playback list are successfully played to completion. In such a scenario, onPlaybackFinished will be invoked on completion.
|
virtual |
Invoked whenever an error occurs.
[in] | error | Appropriate error code telux::common::ErrorCode |
[in] | file | File which was getting played when this error occurred. It can be empty if error occurred before opening any file. |
|
virtual |
Invoked whenever each file has been played from the playlist. If a file is played repeatedly, it will be called that many times. If a file is played indefinitely, it is called every time file is played completely. If an error occurs or playback is stopped, this callback is not called.
[in] | file | File played successfully |
|
virtual |
Invoked to confirm all files have been played gracefully as specified by IAudioPlayer::startPlayback().
class telux::audio::IAudioPlayer |
This class manages playback of a playlist of audio files. The playlist could contain one or more files. Clients can also specify how many times the file should be played, in case repetition is required.
Public Member Functions | |
virtual telux::common::ErrorCode | startPlayback (StreamConfig streamConfig, std::vector< PlaybackFile > &filesToPlay, std::weak_ptr< IPlayListListener > statusListener)=0 |
virtual telux::common::ErrorCode | stopPlayback ()=0 |
virtual | ~IAudioPlayer () |
|
virtual |
Destructor of the IAudioPlayer.
|
pure virtual |
Plays audio files as specified in the playlist. The playlist can contain one or more files to play. How many times a file should be played can also be specified. If a file is played indefinitely, playback can be stopped by calling stopPlayback() at any time.
On platforms with access control enabled, the caller must have TELUX_AUDIO_PLAY, permission to invoke this method successfully.
[in] | streamConfig | Audio stream parameters (format, sampling rate, devices etc.) |
[in] | filesToPlay | List of files to play. They all must be of same format; for example; all PCM or all AMRWB. |
[in] | statusListener | Receives various status updates in IPlayListListener |
|
pure virtual |
Stops the playback started with startPlayback().
On platforms with access control enabled, the caller must have TELUX_AUDIO_PLAY, permission to invoke this method successfully.
|
strong |