From: hackbard Date: Fri, 24 Sep 2004 11:09:56 +0000 (+0000) Subject: added make_raw tool, to create raw sound files X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=ccff379135e4edb378365575a91c2524b05b0144;p=sound-tools%2Fhdrec.git added make_raw tool, to create raw sound files --- diff --git a/.cvsignore b/.cvsignore index 8b5892c..0c27c42 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1,4 @@ hdrec *.wav *.raw +make_raw diff --git a/Makefile b/Makefile index a27d210..1d9af21 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,9 @@ all: $(TARGETS) hdrec: $(CC) $(CFLAGS) -Wall fourier.c oss_api.c hdrec.c -o hdrec -lm -ldirectfb +make_raw: + $(CC) -O3 -Wall make_raw.c -o make_raw -lm + clean: rm $(OBJS) hdrec diff --git a/make_raw.c b/make_raw.c new file mode 100644 index 0000000..6d34f99 --- /dev/null +++ b/make_raw.c @@ -0,0 +1,22 @@ +#include +#include +#include + +/* produce an a + 1st and 3rd "oberschwingung" as a raw file for 44100 sr */ + +int main() { + + int i; + short m; + + for(i=0;i<100000;i++) { + m=0.2*0x7fff*sin(2.0*M_PI*((double)i*440/44100)); + m+=0.4*0x7fff*sin(4.0*M_PI*((double)i*440/44100)); + m+=0.3*0x7fff*sin(8.0*M_PI*((double)i*440/44100)); + write(1,&m,2); + write(1,&m,2); + } + + return 1; +} +