/************ * Includes * *********/ #include #include "sndbuf.h" /************* * Constants * **********/ #define SBUF_OUT "/dev/dsp" #define SBUF_CHAN 2 #define SBUF_TYPE int #define SBUF_LEN 10*88200 #define ARGC_EXPECTED 2 #define ARGV_ME 0 #define ARGV_FILENAME 1 /******** * Main *******/ int main(int argc, char** argv) { //-- Variable Declarations -- sndbuf mybuf(SBUF_CHAN, SBUF_LEN); //The sound buffer we're working with //-- Setup -- if (2 != argc) { fprintf(stderr, "Usage: %s \n", argv[ARGV_ME]); exit(1); } //-- Read -- printf("Reading..."); mybuf.file_read(argv[ARGV_FILENAME]); printf(" Done.\n"); //-- Play Sound -- printf("Playing..."); mybuf.dsp_open(SBUF_OUT); mybuf.dsp_play(); mybuf.dsp_close(); printf(" Done.\n"); }