/* * This program produces the sound of the input dsp file * CSE461 * Autumn 2002 */ #include #include #include int main(int argc, char** argv) { int comLen; char* comBuf; if (argc != 2) { printf("Command line: \"s \"\n"); exit(-1); } comLen = strlen("cat ") + strlen(argv[1]) + strlen(" > /dev/dsp"); comBuf = malloc((comLen+1)*sizeof(char)); sprintf(comBuf, "cat %s > /dev/dsp", argv[1]); system(comBuf); return 0; }