Switchboard SDK
|
Provides an interface to provide audio data in chunks. More...
#include <AudioPlayerSource.hpp>
Public Member Functions | |
virtual | ~AudioPlayerSource ()=default |
Default destructor. | |
virtual const uint | getSampleRate () const =0 |
Gets the sample rate of the audio. | |
virtual const uint | getNumberOfChannels () const =0 |
Gets the number of channels of the audio. | |
virtual const uint | getNumberOfFrames () const =0 |
Gets the number of frames of the audio. | |
virtual const bool | isFinished () const =0 |
Checks if the provided audio has reached its end. | |
virtual const bool | isLoopingEnabled () const =0 |
Indicates whether looping of the audio is enabled. | |
virtual void | setLoopingEnabled (bool enabled)=0 |
Enables or disables the looping of the loaded audio. | |
virtual const double | getDuration () const =0 |
Gets the duration of the currently playing media. | |
virtual const double | getPosition () const =0 |
Indicates the current position of the playhead. | |
virtual void | setPosition (double position)=0 |
Sets the playhead to the desired position. | |
virtual double | getStartPosition () const =0 |
virtual void | setStartPosition (double startPosition)=0 |
virtual double | getEndPosition () const =0 |
virtual void | setEndPosition (double endPosition)=0 |
virtual const uint | read (float *outputBuffer, const uint numberOfFrames)=0 |
Gets the next available chunk of audio. | |
Provides an interface to provide audio data in chunks.
AudioPlayerSource interface.
It can be used to implement audio streaming.
|
pure virtual |
Gets the duration of the currently playing media.
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.
|
pure virtual |
Indicates the current end position of the playback.
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.
|
pure virtual |
Gets the number of channels of the audio.
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.
|
pure virtual |
Gets the number of frames of the audio.
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.
|
pure virtual |
Indicates the current position of the playhead.
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.
|
pure virtual |
Gets the sample rate of the audio.
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.
|
pure virtual |
Indicates the current start position of the playback.
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.
|
pure virtual |
Checks if the provided audio has reached its end.
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.
|
pure virtual |
Indicates whether looping of the audio is enabled.
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.
|
pure virtual |
Gets the next available chunk of audio.
outputBuffer | The buffer that will contain the output samples. |
numberOfFrames | The number of samples to put in the output buffer. |
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.
|
pure virtual |
Sets the ending position of the playback.
endPosition | The desired position in seconds. |
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.
|
pure virtual |
Enables or disables the looping of the loaded audio.
enabled | True when it is enabled, false when it is not. |
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.
|
pure virtual |
Sets the playhead to the desired position.
position | The desired position in seconds. |
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.
|
pure virtual |
Sets the starting position of the playback.
startPosition | The desired position in seconds. |
Implemented in switchboard::AudioPlayerFileSource, and switchboard::AudioPlayerMemorySource.