Hello everyone.
I’ve basically copied the example from AudioThumbnailTutorial into my app and trying to play a wave file when I get a division by zero in ResamplingAudioSource::getNextAudioBlock (buffer not valid).
I can get around this by manually calling transportSource.prepareToPlay() again, but how do I know what values I need to pass in?
File f(currentTrackInfo.filename);
AudioFormatReader* reader = formatManager.createReaderFor(f);
if (reader != nullptr)
{
ScopedPointer<AudioFormatReaderSource> newSource = new AudioFormatReaderSource(reader, true);
transportSource.setSource(newSource, 0, nullptr, reader->sampleRate);
readerSource = newSource.release();
//transportSource.prepareToPlay(448, 44100);
}
My component that does does inherits from AudioAppComponent.
I’ve probably just not quite understood how this works.
Thanks
// E