WAV Reading Issue: 0 Length


#1

Hi Jules,

I’ve run into an issue while loading audio files of the format WAV; it seems the juce::WavAudioFormatReader doesn’t recognize the data correctly, giving me a 0 length reader. Will look into it in depth when I find the time today…

Here is an example file that demonstrates this. May be worth noting that I used FreeMake to create this file.


#2

The format tag is wrong. If you change it (2 bytes at offset 0x14) from FE FF to 01 00 (= PCM) the JuceDemo is able to read the file. I’d say this is a bug in Freemake as the data is clearly PCM and I couldn’t find any mentioning of FE FF being a valid format tag.

Chris


#3

That’s quite odd… Okay so, even with that in mind; it doesn’t explain why VLC, Windows Media Player, FL Studio 10.0.9, Adobe Audition 3.1, Pro Tools 10.1 and Sonar 8.5 choose to read/play the file.

Perhaps there are other format tags for PCM-style audio data in wave files? Maybe a hint lies between the lines in the list of wFormatTag IDs in mmreg.h?


#4

Hm… after close inspection of that list; what you’re saying is correct. It would be nice if JUCE were able to tell these things in advance…


#5

Ah, correction; 0xFFFE means “WAVE_FORMAT_EXTENSIBLE”, which means such information is “determined by SubFormat.” (see http://www-mmsp.ece.mcgill.ca/documents/audioformats/wave/wave.html)

And JUCE is correctly checking for this flag; see juce_WavAudioFormat.cpp, line 540.