FreeCalypso > hg > freecalypso-tools
comparison ffstools/tiaud/mkvol.c @ 241:1f3b28d66d53
tiaud-mkvol program written
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 25 Aug 2017 23:57:32 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
240:2568a2a8a453 | 241:1f3b28d66d53 |
---|---|
1 /* | |
2 * This program generates an audio volume file for uploading into Calypso | |
3 * device FFS; TI's Audio Service requires every *.cfg file to be accompanied | |
4 * by a corresponding *.vol file. | |
5 */ | |
6 | |
7 #include <sys/types.h> | |
8 #include <sys/file.h> | |
9 #include <stdio.h> | |
10 #include <stdlib.h> | |
11 #include <unistd.h> | |
12 | |
13 u_char bin[4]; | |
14 | |
15 write_bin_output(filename) | |
16 char *filename; | |
17 { | |
18 int fd; | |
19 | |
20 fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666); | |
21 if (fd < 0) { | |
22 perror(filename); | |
23 exit(1); | |
24 } | |
25 write(fd, &bin, sizeof bin); | |
26 close(fd); | |
27 } | |
28 | |
29 main(argc, argv) | |
30 char **argv; | |
31 { | |
32 if (argc != 3) { | |
33 fprintf(stderr, "usage: %s volume outfile\n", argv[0]); | |
34 exit(1); | |
35 } | |
36 bin[0] = atoi(argv[1]); | |
37 write_bin_output(argv[2]); | |
38 exit(0); | |
39 } |