BufferedInputStream used in conjunction with AudioFormatManager::createReaderFor was broken by this commit for most mp3 files I tested (on Mac, haven’t tested on Win yet).
The BufferedInputStream is created successfully, but AudioFormatManager::createReaderFor fails.
Reverting the commit fixes the issue. To be more precise, reverting the changes to BufferedInputStream is enough to fix the issue.
To repro, open the AudioPlaybackDemo, and change the following code:
if (audioURL.isLocalFile())
{
reader = formatManager.createReaderFor (audioURL.getLocalFile());
}
to:
if (audioURL.isLocalFile())
{
auto fileStream = std::make_unique<FileInputStream>( audioURL.getLocalFile() );
if ( fileStream->openedOk() )
{
auto bufferedInputStream = std::make_unique<juce::BufferedInputStream>( fileStream.release(), 512*10, true );
reader = formatManager.createReaderFor( std::move( bufferedInputStream ) );
}
}
