[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
item.


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);
>     MessageBox(0,msg,"Test",0);
> 
>     Do I need to do something else with the code? Also, for the _lopen I'm
> using:
>     _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
> http://shoko.calarts.edu/musicdsp/
> 
> 



dupswapdrop -- the music-dsp mailing list and website: subscription info,
FAQ, source code archive, list archive, book reviews, dsp links
http://shoko.calarts.edu/musicdsp/




More information about the music-dsp mailing list