WAV to Binary (8bit)
Martin Czech
martin.czech at intermetall.de
Wed Oct 20 12:12:33 CEST 1999
:::Dear all,
:::
::: Does anyone have, or know of, a way of converting wav files
:::into 8bit unsigned binary files, without any header.. so I could
:::say take a drum sample and put it on an eprom?
:::
::: Paul
:::
Dear Paul (;->)
I've been just diving into the complications of the RIFF (.wav) format
this weekend, in order to be able to read any .wav file and to process
it, and to write a regular new .wav file.
I've done some C-routines for that, and I've done a pseudo C data
structure, which shows the different chunks and so on. I claim that
this material is more understandable then anything else I've found on
the web so far.
The usual documents have implicit information I don't know about,
so I took those papers and two ascii/hex dumps of a Cooledit .wav
and a Soundforge .wav to see what it is all about.
After 2 hours I got it.
The actuall C code is written for 16bit mono support, for obvious reasons.
I wanted to dump all this stuff into my web site, if finished.
If you want, I can mail it to you as it is now. It works.
It is easy to adapt to 8 bits.
This would be a way for your own program code.
If you have a hexdump tool, look into the file. Search the data chunk.
Ie. look for the character sequence "data". (First comes "RIFF" then
"WAVE", then "fmt ", finally "data". Then after data a 4 bytes unsigned
word will follow, LSB first, this indicates the remaining length of the
chunk, ie. number of samples. Then directly after that the samples,
they are allreay unsigned format. So you can easily determine how many
bytes your header has, and you can snip it of.
If you only need it once, better use tools like Cooledit, I know it can
read any binary, and I THINK it can write binarys as well.
m.c.
More information about the Synth-diy
mailing list