From: hackbard Date: Sat, 27 Mar 2004 15:48:34 +0000 (+0000) Subject: lol, some bullshit X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7381c003a9a9979fb2b7d2be4ee937fdf7cb15fb;p=sound-tools%2Fhdrec.git lol, some bullshit --- 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; +}