View Single Post
  #10 (permalink)  
Old 09-24-2007, 10:10 PM
Richard Dobson
Guest
 
Posts: n/a
Default Re: 32 bit integer WAV file writer?

Vladimir Vassilevsky wrote:
>
>
> Richard Dobson wrote:
>
>> Vladimir Vassilevsky wrote:
>>
>>>
>>> Here is the utterly lazy method for writing WAVs:
>>>
>>> 1. Create a wav with the required parameters in the standard Windows
>>> Sound Recorder.
>>>
>>> 2. Cut the header off. If you don't want to know what is the size of
>>> the header, ~100 bytes from the beginning of the file will do.
>>>
>>> 3. Attach that header to your file

...
> I have done it that way ~20 years ago. Surprisingly, it works just fine.
> What is the problem?
>



It's wrong. You ~may~ get away with it if your ambitions do not extend
beyond mono/stereo 8/16bit audio, and play programs are kind enough not
to pay much attention to the probably wrong RIFF and data chunk duration
fields in your hacked header. Methods devised 20 years ago may need to
be updated. Oh, and Sound Recorder does not support any 32bit sample
formats.

>
> Stupid questions deserve the dumb answers. The invasion of the dolts is
> what is killing the group.
>


What was stupid about it? 32bit int is sufficiently rare for soundfiles
that very little casually-written software handles it (which is why
everyone is referred to libsndfile, sooner or later). Even the suggested
"writewav.m" is inadequate (written in 1998, so predates
WAVEFORMATEXTENSIBLE). And of course (as of the last time I looked at
it) the resident matlab wavwrite.m function doesn't know about it either.

Richard Dobson

Reply With Quote