WAV file Loop Points


Guys, I know this have been discussed before, but it didn't help me out, and google didn't help and nor the forum search... so, what I'm trying to figure out is how the heck can I use the JUCE WAV class to read loop point information from a WAV file?

Thank you all in advance! ;-)


There is no loop point info in a normal WAV file - you can pull out Acid and BWAV data if it was saved in thpse formats, and you might find some clues in there.


If the wav files contain loop or cue data it will be written into the AudioFormatReader's metadataValues member. Take a look at to top of juce_WavAudioFormat.cpp to see where all the different chunks get parsed.


Thanks guys, I already found those, but could not for the life of me find how to work those out... :-(


Another thing I don't get, how come WAV files don't have loop points if all my life as a VST coder I have using WAV files that have loop points? I used SoundForget to add those, and now Wavosaur.

I still can't figure out how to extract the loop-start and loop-end using the JUCE code. :-(


Like I said, the info you're talking about is probably in some sort of custom chunk. It's not part of the core WAV spec though, so not all files will contain this.

And like Dave said, look at the metadata. If you open one of the files you're trying to read, and print out all of its metadata values, it should be pretty clear which ones you need to use.


A description of the wav format complete w/ all possible chunks incl loop points!


There's even source code to be found for hard core loopers:

LoopAuditioneer http://loopauditioneer.sourceforge.net/

Hopefully this will help you find out how to extract the loop points!





It really seems like the loop points are already available in juce wavAudioFormat. All read in and ready to use! Or am I staring at some dead code leftovers?


Thanks guys, I will work more on this tomorrow and see if I can figure this out. I get what you all say, I'm just a bit slow most of the times... ;-)


Ok, the WAV files I tested all show Loop0Start and Loop0End. ;-)


                FileChooser getFile("Import Single Cycle Waveform", dataFolder + "Modules Extras" + File::separator + "Drawable OSC" , "*.WAV;*.AIFF");
                if (getFile.browseForFileToOpen())
                    AudioFormatManager formatManager;
                    ScopedPointer<AudioFormatReader> reader = formatManager.createReaderFor(getFile.getResult());
                    if (reader != nullptr && reader->lengthInSamples > 0 && reader->numChannels > 0)



Sorry to bump a topic this old, but what about support for writing the loop points/cue markers with the WavAudioFormat?

edit : OK, sorry, I didn’t look into the WavAudioFormat implementation before posting. There seems to be something for this in there…