Re: Wave File Header Size
- From: NoSpam@xxxxxxxxxxx (Bob Masta)
- Date: Fri, 30 Mar 2007 13:42:53 GMT
On Thu, 29 Mar 2007 17:48:18 -0400, "Scott McPhillips [MVP]"
<org-dot-mvps-at-scottmcp> wrote:
skibud2 wrote:
I have a .wav file. It is compressed with 8Khz ADPCM compession. Here
is a snap shot of the header:
00000000: 5249 4646 6c96 0000 5741 5645 666d 7420 RIFFl...WAVEfmt
00000010: 3200 0000 0200 0100 401f 0000 0010 0000 2.......@.......
00000020: 0001 0400 2000 f401 0700 0001 0000 0002 .... ...........
00000030: 00ff 0000 0000 c000 4000 f000 0000 cc01 ........@.......
00000040: 30ff 8801 18ff 6661 6374 0400 0000 2025 0.....fact.... %
00000050: 0100 6461 7461 1a96 0000 0010 0000 0000 ..data..........
The 'data' string doesn't happen to 0x52. Every webpage that I have
found say that the wave header says that it should be 44 bytes. Am I
missing something? Where can I find the appropriate header structure?
This file plays perfectly fine on the PC.
The file format permits optional chunks. You can never assume that the
header is a fixed number of bytes. It looks like your file contains an
optional "fact" chunk, which is a fine example of what can be
encountered. You might also encounterd optional chunks containing a
copyright, song title, etc., etc., etc.
You can find a specification of the file format at wotsit.org, and
sample code in MSDN for parsing the chunks. A shortcut: search for the
"data" string in the header.
--
As I recall, the RIFF format is pretty clear on what
chunks may be encountered, but pretty UNclear on
what order they may appear in. Like, can any other
chunks besides "fact" appear before "data"? Or
should they always appear after it?
Those questions are relevant when creating files.
The only approved strategy when reading files is to
read all the chunk descriptors and ignore any
chunks you don't understand. The RIFF format
was designed to make that easy, since each chunk
tells you how many bytes to skip, in the size field
right after the name.
Best regards,
Bob Masta
D A Q A R T A
Data AcQuisition And Real-Time Analysis
www.daqarta.com
Scope, Spectrum, Spectrogram, Signal Generator
Science with your sound card!
.
- References:
- Wave File Header Size
- From: skibud2
- Re: Wave File Header Size
- From: Scott McPhillips [MVP]
- Wave File Header Size
- Prev by Date: Re: Request: MixList.EXE reports
- Next by Date: Re: Mixer control
- Previous by thread: Re: Wave File Header Size
- Next by thread: Re: Media Center Extender
- Index(es):
Relevant Pages
|