[LAU] Input to aplay to make a file instead?

Paul Davis paul at linuxaudiosystems.com
Sun Apr 19 02:28:37 CEST 2020


On Sat, Apr 18, 2020 at 5:49 PM Gerhard Zintel <gerhard.zintel at web.de>
wrote:

>
> One further remark. The wave header has two length information at byte
> offset 5 and 41
> (see http://www.topherlee.com/software/pcm-tut-wavformat.html). You can
> use dd like described
> here (
> https://unix.stackexchange.com/questions/214820/patching-a-binary-with-dd)
> to patch
> the created file newname.wav afterwards to inject the correct length
> information.
>

being pedantic just for the sake of it ....

WAV is a subformat of the RIFF file format, which uses a set of "chunks"
with a 4 byte ID and a 4 byte length for each chunk.

Although it is conventional for the various chunks to come in a fairly
standard order (RIFF .. WAV .. FMT), nothing about the standard requires
this, and the correct way to parse any RIFF file (and hence any WAV file)
is chunk by chunk. Making assumptions about byte offsets will work in the
majority of cases, but will break in some.

In addition, the length information at byte 5 (which actually is constant,
since that's the outermost RIFF chunk, is the length of the entire file,
not the WAV data length.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.linuxaudio.org/archives/linux-audio-user/attachments/20200418/26bd93ff/attachment.html>


More information about the Linux-audio-user mailing list