Ok, so did you verify that this condition is actually hit?
To playback the audio I would suggest to use an AudioSource, which takes care of the position and how to slice the audio in playable buffers.
For instance use an AudioFormatReaderSource and call getNextAudioBlock() in each processBlock() call.
AudioFormatReaderSource* source = nullptr;
void prepareToPlay (double sampleRate, int estimatedSamplesPerBuffer) override
auto* inputStream = new MemoryInputStream (BinaryData::country_sample_wav, BinaryData::country_sample_wavSize, false);
auto* reader = format.createReaderFor (inutStream, true); // takes ownership
source = new AudioFormatReaderSource (reader, true); // takes ownership
source->prepareToPlay (estimatedSamplesPerBuffer, sampleRate);
void processBlock (AudioBuffer<float>& buffer, MidiBuffer&) override
if (source == nullptr)
AudioSourceChannelInfo info (&buffer, 0, buffer.getNumSamples());
source->getNextAudioBlock (info); // only ok because of MemoryInputStream!
later you might change that to load into a buffer and actually work with that