From 7381c003a9a9979fb2b7d2be4ee937fdf7cb15fb Mon Sep 17 00:00:00 2001 From: hackbard Date: Sat, 27 Mar 2004 15:48:34 +0000 Subject: [PATCH] lol, some bullshit --- resample.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 resample.c diff --git a/resample.c b/resample.c new file mode 100644 index 0000000..75b5590 --- /dev/null +++ b/resample.c @@ -0,0 +1,47 @@ +/* resample.c -- resample audio file (just raw) */ + +/* hackbard@hackdaworld.dyndns.org */ + +#include +#include +#include +#include +#include + +int usage() { + puts("usage: resample "); + return 1; +} + +int main(int argc,char **argv) { + int src_fd,dst_fd; + int i; + unsigned char buf[2]; + + + if(argc!=3) { + usage(); + return -1; + } + + src_fd=open(argv[1],O_RDONLY); + if(src_fd<0) { + printf("can't open %s\n",argv[1]); + return -1; + } + + dst_fd=open(argv[2],O_WRONLY|O_CREAT); + if(dst_fd<0) { + printf("can't open %s\n",argv[2]); + return -1; + } + + i=1; + while(i) { + i=read(src_fd,buf,2); + write(dst_fd,buf,2); + write(dst_fd,buf,2); + } + + return 1; +} -- 2.20.1