OpenShot Library | libopenshot-audio 0.2.0
|
An AudioSource which takes some float audio data as an input. More...
#include <juce_MemoryAudioSource.h>
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. | |
![]() | |
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 | |
![]() | |
AudioSource ()=default | |
Creates an AudioSource. | |
An AudioSource which takes some float audio data as an input.
Definition at line 36 of file juce_MemoryAudioSource.h.
juce::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.
Definition at line 26 of file juce_MemoryAudioSource.cpp.
References juce::AudioBuffer< Type >::getArrayOfWritePointers(), juce::AudioBuffer< Type >::getNumChannels(), juce::AudioBuffer< Type >::getNumSamples(), juce::AudioBuffer< Type >::makeCopyOf(), and juce::AudioBuffer< Type >::setDataToReferTo().
|
overridevirtual |
Implementation of the AudioSource method.
Implements juce::AudioSource.
Definition at line 38 of file juce_MemoryAudioSource.cpp.
|
overridevirtual |
Implementation of the AudioSource method.
Implements juce::AudioSource.
Definition at line 43 of file juce_MemoryAudioSource.cpp.
|
overridevirtual |
Implementation of the AudioSource method.
Implements juce::AudioSource.
Definition at line 45 of file juce_MemoryAudioSource.cpp.
References juce::AudioSourceChannelInfo::buffer, juce::AudioBuffer< Type >::getNumChannels(), juce::AudioBuffer< Type >::getNumSamples(), juce::AudioSourceChannelInfo::numSamples, and juce::AudioSourceChannelInfo::startSample.