An AudioSource which takes some float audio data as an input. More...
Public Member Functions | |
MemoryAudioSource (AudioBuffer< float > &audioBuffer, bool copyMemory, bool shouldLoop=false) | |
Creates a MemoryAudioSource by providing an audio buffer. | |
void | prepareToPlay (int samplesPerBlockExpected, double sampleRate) override |
Implementation of the AudioSource method. | |
void | releaseResources () override |
Implementation of the AudioSource method. | |
void | getNextAudioBlock (const AudioSourceChannelInfo &bufferToFill) override |
Implementation of the AudioSource method. | |
void | setNextReadPosition (int64 newPosition) override |
Implementation of the PositionableAudioSource method. | |
int64 | getNextReadPosition () const override |
Implementation of the PositionableAudioSource method. | |
int64 | getTotalLength () const override |
Implementation of the PositionableAudioSource method. | |
bool | isLooping () const override |
Implementation of the PositionableAudioSource method. | |
void | setLooping (bool shouldLoop) override |
Implementation of the PositionableAudioSource method. | |
![]() | |
~PositionableAudioSource () override=default | |
Destructor. | |
virtual void | setNextReadPosition (int64 newPosition)=0 |
Tells the stream to move to a new position. | |
virtual int64 | getNextReadPosition () const =0 |
Returns the position from which the next block will be returned. | |
virtual int64 | getTotalLength () const =0 |
Returns the total length of the stream (in samples). | |
virtual bool | isLooping () const =0 |
Returns true if this source is actually playing in a loop. | |
virtual void | setLooping (bool shouldLoop) |
Tells the source whether you'd like it to play in a loop. | |
![]() | |
virtual | ~AudioSource ()=default |
Destructor. | |
virtual void | prepareToPlay (int samplesPerBlockExpected, double sampleRate)=0 |
Tells the source to prepare for playing. | |
virtual void | releaseResources ()=0 |
Allows the source to release anything it no longer needs after playback has stopped. | |
virtual void | getNextAudioBlock (const AudioSourceChannelInfo &bufferToFill)=0 |
Called repeatedly to fetch subsequent blocks of audio data. | |
Additional Inherited Members | |
![]() | |
PositionableAudioSource ()=default | |
Creates the PositionableAudioSource. | |
![]() | |
AudioSource ()=default | |
Creates an AudioSource. | |
An AudioSource which takes some float audio data as an input.
MemoryAudioSource::MemoryAudioSource | ( | AudioBuffer< float > & | audioBuffer, |
bool | copyMemory, | ||
bool | shouldLoop = false |
||
) |
Creates a MemoryAudioSource by providing an audio buffer.
If copyMemory is true then the buffer will be copied into an internal buffer which will be owned by the MemoryAudioSource. If copyMemory is false, then you must ensure that the lifetime of the audio buffer is at least as long as the MemoryAudioSource.
|
overridevirtual |
Implementation of the AudioSource method.
Implements AudioSource.
|
overridevirtual |
Implementation of the AudioSource method.
Implements AudioSource.
|
overridevirtual |
Implementation of the AudioSource method.
Implements AudioSource.
|
overridevirtual |
Implementation of the PositionableAudioSource method.
Implements PositionableAudioSource.
|
overridevirtual |
Implementation of the PositionableAudioSource method.
Implements PositionableAudioSource.
|
overridevirtual |
Implementation of the PositionableAudioSource method.
Implements PositionableAudioSource.
|
overridevirtual |
Implementation of the PositionableAudioSource method.
Implements PositionableAudioSource.
|
overridevirtual |
Implementation of the PositionableAudioSource method.
Reimplemented from PositionableAudioSource.