--- /dev/null
+/* resample.c -- resample audio file (just raw) */
+
+/* hackbard@hackdaworld.dyndns.org */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+int usage() {
+ puts("usage: resample <src> <dst>");
+ 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;
+}