43 int startSampleOffset,
int numSamplesToUse) noexcept
44 : buffer (bufferToUse),
45 startSample (startSampleOffset),
46 numSamples (numSamplesToUse)
55 : buffer (&bufferToUse),
57 numSamples (bufferToUse.getNumSamples())
90 if (buffer !=
nullptr)
91 buffer->
clear (startSample, numSamples);
151 virtual void prepareToPlay (
int samplesPerBlockExpected,
152 double sampleRate) = 0;
166 virtual void releaseResources() = 0;
void clearActiveBufferRegion() const
Convenient method to clear the buffer if the source is not producing any data.
#define JUCE_API
This macro is added to all JUCE public class declarations.
int numSamples
The number of samples in the buffer which the callback is expected to fill with data.
AudioSourceChannelInfo(AudioBuffer< float > &bufferToUse) noexcept
Creates an AudioSourceChannelInfo that uses the whole of a buffer.
Base class for objects that can produce a continuous stream of audio.
int startSample
The first sample in the buffer from which the callback is expected to write data. ...
AudioBuffer< float > * buffer
The destination buffer to fill with audio data.
AudioSourceChannelInfo(AudioBuffer< float > *bufferToUse, int startSampleOffset, int numSamplesToUse) noexcept
Creates an AudioSourceChannelInfo.
Used by AudioSource::getNextAudioBlock().
void clear() noexcept
Clears all the samples in all channels.