79 int readAheadBufferSize = 0,
81 double sourceSampleRateToCorrectFor = 0.0,
82 int maxNumChannels = 2);
94 void setPosition (
double newPosition);
99 double getCurrentPosition()
const;
102 double getLengthInSeconds()
const;
105 bool hasStreamFinished()
const noexcept;
130 void setGain (
float newGain)
noexcept;
135 float getGain() const noexcept {
return gain; }
139 void prepareToPlay (
int samplesPerBlockExpected,
double sampleRate)
override;
142 void releaseResources()
override;
149 void setNextReadPosition (
int64 newPosition)
override;
152 int64 getNextReadPosition()
const override;
155 int64 getTotalLength()
const override;
158 bool isLooping()
const override;
169 float gain = 1.0f, lastGain = 1.0f;
171 double sampleRate = 44100.0, sourceSampleRate = 0;
172 int blockSize = 128, readAheadBufferSize = 0;
173 bool isPrepared =
false;
175 void releaseMasterResources();
Base class for objects that can produce a continuous stream of audio.
An AudioSource that takes a PositionableAudioSource and allows it to be played, stopped,...
float getGain() const noexcept
Returns the current gain setting.
bool isPlaying() const noexcept
Returns true if it's currently playing.
An AudioSource which takes another source as input, and buffers it using a thread.
Holds a list of ChangeListeners, and sends messages to them when instructed.
A type of AudioSource which can be repositioned.
A type of AudioSource that takes an input source and changes its sample rate.
A thread that keeps a list of clients, and calls each one in turn, giving them all a chance to run so...
long long int64
A platform-independent 64-bit integer type.
Used by AudioSource::getNextAudioBlock().