I’m just coming to grips with what seems to be the current audio scheme, and although I probably have a way to go, I thinking I’m hitting something that probably is a bug.
My AudioTransportSource uses a ResamplingAudioSource and then a BufferingAudioSource and it’s getting stuck in a loop, at the end here:
[code]void BufferingAudioSource::prepareToPlay (int samplesPerBlockExpected, double sampleRate_)
{
source->prepareToPlay (samplesPerBlockExpected, sampleRate_);
sampleRate = sampleRate_;
buffer.setSize (2, jmax (samplesPerBlockExpected * 2, numberOfSamplesToBuffer));
buffer.clear();
bufferValidStart = 0;
bufferValidEnd = 0;
SharedBufferingAudioSourceThread::getInstance()->addSource (this);
while (bufferValidEnd - bufferValidStart < jmin (((int) sampleRate_) / 4,
                                                 buffer.getNumSamples() / 2))
{
    SharedBufferingAudioSourceThread::getInstance()->notify();
    Thread::sleep (5);
}
}[/code]
Since this class took a lock on my movie structures, that’s game over for me. I guess the other thread is meant to change something to release it, but it never does.
On a side note, not sure what I’m missing. I have the AudioDeviceManager, which has an AudioSourcePlayer as a source. When needed, I change the source of the AudioSourcePlayer, along with the sample rate and telling it to use a buffer.
The source is an AudioTransportSource, and in turn it has a PositionableAudioSource subclass that tries to access the actual samples, from a movie file, sample by sample.
What I hear is something, but about 10 seconds late, at a weird speed, and quite garbled. Next I’ll probably start injecting tets samples, but am I doing something weird? Did I miss a step? There seem to be a lot of classes, but little configuration. The only heavily overriding I did was the PositionableAudioSource that actually does the work.
Bruce
[/code]
