
Software "waver" and related documentation, creates WAV sound files.
Limited (among other things) to pure tones one after another at constant volume.
There can also be a jarring click sound with tone changes.

USAGE: $ cat number-file.txt | waver > myaudiofile.wav ;

ALSO:  the script 'notes.sh' can be used as a preprocessor
       to create a number-file using alias for frequency numbers.
       see doc/notes.txt for details
       
       e.g. $ sh notes.sh <infile>.notes <outfile>.txt

       ## even if you put gaps between notes there is irritating clicking.
       ## maybe we can fix that by making waver.c taper off volume...

Check out the examples/ and wav/ folders for demonstration input and output!
The results aren't great but we got a good start.

Written* by Wayne Colvin (waynecolvin @ hotmail . com)
Wed June 12th, 2013 through Thurs June 13th, 2013 (2013-6-12 .. 2013-6-13).

*File 'notes.sh' and related examples & documentation edit/added June 14th.

Use freely* as you wish, USE AT OWN RISK, Enjoy! =)

*Some files in doc/ folder not written by myself or copied info off internet.
*It appears ownership of "Mary Had A Little Lamb" (written 1830) is in dispute.

--------------------------

Stupid program that reads <frequency> <millisecond_duration> pairs from stdin
and writes a binary WAV audio file directly through stdout.

USAGE: $ cat number-file.txt | waver > myaudiofile.wav ;

--> if binary to stdout results in a garbled terminal font try $ sh reclear.sh ;

See examples/ wav/ folders for a demonstration input and output.

Both numbers in pair should be whole numbers.

The default (and hard coded) limit is up to 5 cumlative minutes,
but something like $ yes "0 1" | ./waver > out.wav ; hangs for some reason.

This idea is kinda like old DOS beep-programs but generates a WAV audio file
instead of activating PC speaker.

Just like the bad ol' days lol.

NOTE: I'm not actually that old depending who you ask
but used an old Windows 98 (r) laptop for awhile and an older machine too...

<code>
     (* the bad ol' days, would've been slightly worse than this *)
     WHILE NOT Eof() DO
         Read(freq); ReadLn(millisec);
         Sound(freq); Delay(millisec);
     END
     NoSound();
</code>

e.g. echo "440 1000" | bin/waver > 440hz.wav ## one second playing time

The doc/ folder has a couple saved webpages (MHTML web archives) that
describe the WAV file format in enough detail to follow the code.

There is alot more to the file format but this program uses an easy subset.

It should be possible to convert your creations into other formats. :)

The program generates Linear PCM with little endian signed 16-bit integers.
FFmpeg calls this format/codec "pcm_s16le", use ffmpeg to convert formats.

The supplied binary is for an arm-eabi Android(tm) system if you
have a terminal app to run it in.

Normally Android mounts the sdcard as noexec so you will
need to drop it into an folder accessable to terminal or be root.

This should re-compile on other systems too, but you never know...

Program SHOULD output little endian format even on big endian machines.
Takes two's-compliment negative integers for granted,
sorry if you're on a one's-compliment machine.

--------------------

The program source has more comment text than this entire README.txt!

To build: $ agcc -march=armv4 waver.c -o waver ; # or similar
A makefile/build script are also provided.

Also try: $ make test ;

