[music-dsp] How do I read the Loop information from a .WAV file?
Fabio de Matos Quaresma Goncalves
fabio.matos at terra.com.br
Sat Nov 30 13:25:40 EST 2002
dwStart and dwEnd should be unsigned dwords, since there's no meaning
in starting a loop before the start of the stream.
Since that, you should read a REALLY BIG number in your screen.
Several times i had problems when trying to figure out what those
headers just meant. My first problem was reading in text mode,while i
should've used binary.
My second and most annoying problem was reading from the wrong offset
point. This means i was reading c[i] when information was on c[i+j].
Last, you should take care of byte ordering ( little/big endian ). Wav
files were developed by M$ in i386, so most people shouldn't bother this
On Sat, 2002-11-30 at 15:36, musicdsp at dashsynthesis.com wrote:
> Alex, BIG thanxs. That works perfect. The only problem is that the
> values are not correct.
> smpl.dwStart and smpl.dwEnd returns negative values, and that doesn't
> match the loop information I set on SoundForge. Also, just to be sure,
> there's no extra header info or any other loop info, I checked. ;-)
> I'm using this to check for the values, maybe I did something wrong?
> sprintf(msg, "Start=%d - End=%d", smpl.dwStart, smpl.dwEnd);
> Do I need to do something else with the code? Also, for the _lopen I'm
> _lopen(filePath, OF_READWRITE);
> Regards, Wk
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.423 / Virus Database: 238 - Release Date: 25/11/02
> dupswapdrop -- the music-dsp mailing list and website: subscription info,
> FAQ, source code archive, list archive, book reviews, dsp links
dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
More information about the music-dsp