[vorbis-dev] WAV header (hey Mike)

Kenneth Arnold kcarnold at yahoo.com
Mon Aug 21 07:38:16 PDT 2000



On Thu, Aug 10, 2000 at 05:29:52PM +1000, Michael Smith wrote:
> At 10:01 PM 8/9/00 -0600, you wrote:
> >Not really sure what you're seeing here that's so abnormal other than the
> >PAD chunk.  Many RIFF tools (mosly video encoders) write RIFFs with
> >similar blocks (i.e. JUNK, INFO)
> >
> >Anything reading RIFFs should not have a hard-coded sequence of expected
> >chunks.  Any FCC is legal within the context of a RIFF; if a player runs
> >into a chunk with an unknown FCC it's expected to simply ignore it.
> 
> Yeah. I copied the wav header code from somewhere else. I didn't have any
> info. on the format at the time, which makes it rather harder. 

Probably from vorbize (mine)? Well that came from the WAV _writing_ code
for mpg123 (which came from who-knows-where); I never considered that a
valid WAV-format RIFF file could be produced in any other way than written.

> Having since gained a Clue(TM) about this, I'll try and make the header
> parser work reliably (rather than just expecting a list of chunks). 
> 
> If someone could point me at a reasonably comprehensive spec for the wav
> format, that'd be even better.

There's probably a bunch of other stuff that's broken in the same way ;)

How about we steal the WAV code from sox? That handles more obscure formats,
too, and (with sox's effects layer; we wouldn't have to pull the whole thing
in for it though) changing bitrates and stuff...

but using a library already written for the purpose would be better IMHO. My
original stuff was hackish and it's amazing how long it has survived. At least
it works in 95% of the cases (like most sane WAV writers...) Unfortunately
insanity shows up sooner or later.

Or just require that everybody use a sane WAV writer, or use sox to deal with
it first :)

Kenneth

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/



More information about the Vorbis-dev mailing list