Raw byte string to WAV file converter
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
COPYING Initial commit Apr 17, 2017
Makefile
README.md small changes Apr 17, 2017
example.c renamed example Apr 17, 2017
raw2wav.cpp
raw2wav.exe Initial commit Apr 17, 2017
raw2wav.out

README.md

raw2wav

Raw byte string to WAV file converter. This was put together in roughly 30 minutes because apparently there are no easy ways to compile bytebeat entries (the classical variety, not the floating-point / JavaScript one) losslessly.

Synopsis

raw2wav <filename> [<duration>] [<refresh>]

Description

Reads bytes from the standard input, and exports a WAV file called <filename>. Every byte corresponds to an 8-bit unsigned audio sample. The output file is at most <duration> seconds long (default 30) using <refresh> as the sample rate (default 8000 Hz).

Example

$ 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.

License

MIT License.