Joined: 16 Oct 2003
|Posted: Thu Oct 16, 2003 5:07 am Post subject: Problem reading WAV files containing non-data chunks
|I recently began using a Sonifex Courier digital recorder
and encountered problems using the resulting files with
Wavesurfer, including version 1.5.4.
Wavesurfer announces that it has read the file but produces
an empty display, The problem results from the format of the
wav files generated by the Sonifex. As seen in the report
generated by my wavinfo program on the structure of a typical file,
the files produced by the Sonifex include not only a header and
a data chunk but a cue chunk, a playlist chunk and a padding
chunk that causes the audio data to start at offset 32K.
0: RIFF identifier.
4: chunk size = 4,108,536 bytes.
8: WAV identifier.
12: format chunk identifier
16: format chunk size = 16 bytes.
22: one channel (mono).
24: Sampling Rate = 22,050 samples per second.
28: Average Data Rate = 44,100 bytes per second.
32: Bytes_Per_Sample value of 2 indicates 16 bit mono
34: Bits_Per_Sample = 16.
36: chunk id
40: chunk length
44: chunk of type cue (standard) length 28 bytes
72: chunk id
76: chunk length
80: chunk of type plst (standard) length 16 bytes
96: chunk id
100: chunk length
104: chunk of type pad (non-standard) length 32,656 bytes
32760: chunk id
32764: chunk length
32768: chunk of type data (standard) length 4,075,776 bytes
amounting to 1 minute and 32.4 seconds
Removing the non-data chunks eliminates the problem.
I suspect that Wavesurfer is reading the first chunk without
checking that it is a data chunk. Since the first chunk
contains the equivalent of only 14 samples, nothing appears
on the display.
For my own purposes I have solved the problem by writing a
program that strips the three extra chunks. Since the
Sonifex is not widely used for research purposes (they are
aimed at journalists, and though quite nice, are very
expensive - by chance I had the opportunity to get one at a
large discount), this may not be a widespread
problem. However, according to my reading of the RIFF
standard, the files produced by the Sonifex are
standard-conforming. So this arguably should be considered a bug.