raw2wav <filename> [<duration>] [<refresh>]
Reads bytes from the standard input, and exports a WAV file called
Every byte corresponds to an 8-bit unsigned audio sample. The output file is at
<duration> seconds long (default 30) using
<refresh> as the sample rate
(default 8000 Hz).
$ yes zzzzzzz | ./raw2wav.out pulse.wav 5
Produces a file which plays a 12.5% pulse wave at 1 kHz for 5 seconds.
$ gcc example.c $ ./a.out | ./raw2wav.out example.wav 20 22050
Produces the first example of this video, but also makes it play much faster.