Reading of FLAC files failing [Turned out to be a non-issue]

Hi there,

The reading of FLAC files has started failing in an app I’m developing. This was previously working perfectly. I see that the FLAC version in JUCE was updated recently with this commit:

…so this would likely be introduced in 7.0.3 (the release after this commit).

I have tried to simplify the problematic code into the following:

File fileToLoad ("/path/to/Audio.flac");
jassert (fileToLoad.existsAsFile()); // this is fine
        
AudioFormatManager formatManager;
formatManager.registerBasicFormats();
std::unique_ptr<AudioFormatReader> reader (formatManager.createReaderFor (fileToLoad));
jassert (reader != nullptr); // this fails

Just to add a couple of things…

  • The file is not corrupted… this file was happily loaded in previous versions of JUCE and other applications (e.g. Audacity)
  • I have run the above code in a simple app outside of our main codebase and re-produced the error.

Let me know if you can help and thanks in advance,

Adam

EDIT: Here is where it seems to be failing in the JUCE codebase…

In the FlacReader constructor, when it calls…

FLAC__stream_decoder_process_until_end_of_metadata (decoder);

then inside that function it fails at this point…

if(!find_metadata_(decoder))
    return false; /* above function sets the status for us */

So that I can debug this locally, are you able to provide an example of an audio file that causes this issue? You should be able to DM it to me if you’d prefer not to share it publicly.

Sure - will do that now :slight_smile:

Argh - sorry. It looks like an installer has been garbling the files. This is totally not an issue.

Apologies.

Great, thanks for letting me know.