#include #include #include #include "sndbuf_smart.h" //-- Command line -- #define ARGC_EXPECTED 4 #define ARGV_ME 0 #define ARGV_CHAN 1 #define ARGV_SAMP 2 #define ARGV_OUTFILE 3 int main(int argc, char** argv) { //-- Variable Declarations -- sndbuf_smart* buf; int samp; //samples int chan; //channels //-- Command line check -- if (ARGC_EXPECTED != argc) { printf("Usage: %s \n", argv[ARGV_ME]); exit(1); } //-- Read Command line ---- chan = atoi(argv[ARGV_CHAN]); samp = atoi(argv[ARGV_SAMP]); //-- Create buffer -- buf = new sndbuf_smart(chan, samp); buf->chan = chan; buf->samp = samp; //-- Generate Tone -- buf->gen_noise(ALL_CHAN); //-- Output Tone -- printf("Writing waveform to \"%s\"...", argv[ARGV_OUTFILE]); buf->file_write(argv[ARGV_OUTFILE]); printf(" Done.\n"); //-- Cleanup -- delete buf; }