diff --git a/README.md b/README.md index 53121c6..b570c12 100644 --- a/README.md +++ b/README.md @@ -18,20 +18,15 @@ With the Rust compiler installed under a Unix-like OS, you can compile this sour ###How to Use Interval can be run at the command line with the following syntax: -`./interval [input file]` -This will produce a WAV RIFF header followed by a PCM audio stream to stdout, which can then be piped into a file, audio -device, or other audio stream acceptor. If you don't pipe it into anything and it dumps the stream out onto the console, -then it will probably flood your screen with garbage text, so be warned. +`./interval [input file] [output file]` +This will attempt to read Interval code from the input file, generate audio based on it, and emit the resulting data, +prefixed with a suitable RIFF header, into the output file (which will be in `.wav` format). The audio stream is signed +16-bit little endian samples, at a sample rate defined by a static variable in the source code (48 kHz by default). ###Example Usage Under Linux with ALSA, you can compile and play a .ITV source file with a command like this: -`./interval test.itv | aplay` - -###Writing to Files -You can pipe the output of the program into a file: -`./interval test.itv > test.wav` -This file will be in standard WAV format, and can be converted to other formats with a conversion tool such as -avconv or ffmpeg. +`./interval test.itv` +This will write WAV data into `test.wav`, creating it if it does not exist and overwriting it if it does. diff --git a/example.wav b/example.wav index 6c7f78b..8ffa75a 100644 Binary files a/example.wav and b/example.wav differ diff --git a/interval.rs b/interval.rs index 3267367..9a3244a 100644 --- a/interval.rs +++ b/interval.rs @@ -159,7 +159,7 @@ Tricks: */ -static RATE:f64 = 44100.0; // audio sample rate in samples/sec +static RATE:f64 = 48000.0; // audio sample rate in samples/sec static TAUS:f64 = 5.0; // number of time contants to allow for notes to finish ringing before ending the output stream use std::io::prelude::*;