Get Looppoints of a .wav



I want to know, how I can get the Looppoints of a wavefile, that i loaded.


String str = "test1.wav";
File f(File::getSpecialLocation(File::userDesktopDirectory).getChildFile(str));
ScopedPointer<WavAudioFormat> _wavAudioFormat = new WavAudioFormat(); 
ScopedPointer<AudioFormatReader> _audioFormatReader = _wavAudioFormat->createReaderFor( f.createInputStream(), true ); 
ScopedPointer<AudioSampleBuffer> _asb = new AudioSampleBuffer(2, _audioFormatReader->lengthInSamples);
_audioFormatReader->read(_asb, 0, _audioFormatReader->lengthInSamples, 0, true, true);

int loopStart = ???;
int loopEnd = ???;


Thx and greetz from Germany

You're not getting answers because your question is not well defined.

What do you mean by "loop points"?  ANY point in your sample could be a loop point!

Do you mean zero crossings?  Go through the sample and look for zeros!  But there will be a lot of them...


OK. sorry for my bad description (and also for my bad English. :-D )

A Wavefile could save looparkers (created for example with wavelab). It is possible to set a start- and endvalue. almost every vst sampler could read them, play this wave from start and if it reach the loop-end point, the readpointer jumps back to the loop-start point. it would be nice, if it is possible to 'read' these points from a wavefile.


It currently reads some metadata like BWAV, Acid, etc, but not sure whether those contain loop points.. Do you know what the chunk type is that contains the info you're looking for? I wouldn't mind adding it if there's one that's commonly used.



I think the Infos are stored in "cue points". Is it possible to get the Cuepoints of a wave?


Eventually not in "cue", but in "smpl" ;-D



Oh yes - it already supports that. Have a look at the SMPLChunk class for more info. Getting the correct names for all the loop metadata is a bit messy, but it's there.