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 |
Get the sample rate of the audio. | |
virtual const uint | getNumberOfChannels () const =0 |
Get the number of channels of the audio. | |
virtual const uint | getNumberOfFrames () const =0 |
Get the number of frames of the audio. | |
virtual const bool | isFinished () const =0 |
Check if the provided audio has reached its end. | |
const bool | isLoopingEnabled () const |
void | setLoopingEnabled (bool enabled) |
virtual const uint | read (float *outputBuffer, const uint numberOfSamples)=0 |
Gets the next available chunk of audio. | |
virtual void | rewind ()=0 |
Sets the audio position back to its start. | |
Protected Attributes | |
bool | loopingEnabled { false } |
Provides an interface to provide audio data in chunks.
AudioPlayerSource interface.
It can be used to implement audio streaming.
|
pure virtual |
Get the number of channels of the audio.
Implemented in switchboard::AudioPlayerMemorySource.
|
pure virtual |
Get the number of frames of the audio.
Implemented in switchboard::AudioPlayerMemorySource.
|
pure virtual |
Get the sample rate of the audio.
Implemented in switchboard::AudioPlayerMemorySource.
|
pure virtual |
Check if the provided audio has reached its end.
Implemented in switchboard::AudioPlayerMemorySource.
const bool switchboard::AudioPlayerSource::isLoopingEnabled | ( | ) | const |
Indicates whether looping of the audio is enabled.
|
pure virtual |
Gets the next available chunk of audio.
outputBuffer | The buffer that will contain the output samples. |
numberOfSamples | The number of samples to put in the output buffer. |
Implemented in switchboard::AudioPlayerMemorySource.
|
pure virtual |
Sets the audio position back to its start.
Implemented in switchboard::AudioPlayerMemorySource.
void switchboard::AudioPlayerSource::setLoopingEnabled | ( | bool | enabled | ) |
Enables or disables the looping of the loaded audio.
enabled | True when it is enabled, false when it is not. |