From 378d09ab71532d175538ef40bb70432e76c75057 Mon Sep 17 00:00:00 2001 From: hackbard Date: Sun, 6 Jul 2003 20:39:35 +0000 Subject: [PATCH] added print info option (still in dev) --- hdrec | Bin 9485 -> 10446 bytes hdrec.c | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/hdrec b/hdrec index bb3f97a260ab910c3ec184a3caf3213df9ed9305..9bfc05fed12ef339e20968c70b4effc07a6d787b 100755 GIT binary patch literal 10446 zcmcgyeRN#Kb)Q`=W-UZk{(urN<^fV-POP=(Ol zZOg@p%xX&(SqF#KIi$7IKu!oreOkAnj&s08U@&$MZ5*GRQxYKM!{zKoN{&lyFtv*M z`^~(Oo@AV~{UftycJ6QPojZ5#+?n^@y!W-{mgOFgN9g1g6@qAP!RMcka`$zLGhY~D zl9(lK5HnB;LEiix$RH1ZX1)yBhg^YtmKi+eX`q?Oqwdk(z!S*BR|~<+_M%$xW!=-@ zAV@^C$7mp=#+k@Fu zaGv5pwX|);n)RSmKa#-T6enMyD^Su7X%osSx*$u8_BR|B;4`uvMfPDRcmZvwvE!SyKPzJzmAgl8sz7J7dp5JB4L?71PviBLSA3X6EwvK|oIGBMi{87mZ_rX*FFtJb1@B$hODSt|l% z>pXHR6Zy%Esq++-;tOjh|VJ3BQZx3r7O!l z5_3e+1;lBIIkM;y;`=1#2%{^BTP5a5qpieCB<6^t8;Ivh%#la$BQ_+a2cjHMxf&Ry zsQ=BD;yd}%XIk6WMc@7gxHSmkyY7zeDf;}SjSxD!XAk_<)>@+U#$87ry-A3^JeNmd z!1j)u?Atti;^>~yqC~5BR>zx{*_(tlZ$S%P8(S zakTiMYX9VEh(P~UhuH>1)vLZ5)|F=LxbRVNX!B@~QvRA^?tEXasPWiZeMZp z*}g5l;-Z>jdyW6qrW)U6t-gWMKYubZvLw*^YiL}!#b?(RH`Vx{){j+M+6CTWx~LCL zp={?cJL%sl`tSDlZSlKQO`@uYm8!?3D!+ZDqw2mt^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`R@?rq!6j?G=&rU}$G4YhAFH*9aYv)x?ZzH#$bsj#JWQag<|@i_A0(g`=$ptmzVk#OtqLdN8U4Ak)OpgwYdEqnoS)i)7W z)yt-G$%u)oBEbh0r>^=i!>tSZc&K4Z?o#<}g$c(^OFrh98#}hGZ|N|%ZP7&Q24cLhYmJApSv(c-0%=-(SA-%u LFm(7_#I5i@gw?VF diff --git a/hdrec.c b/hdrec.c index ac6348e..58cb670 100644 --- a/hdrec.c +++ b/hdrec.c @@ -22,6 +22,7 @@ int usage(void) { printf("usage:\n\n"); printf("-h \t\t print this help\n"); + printf("-i \t\t use/print file info\n"); printf("-r \t record to \n"); printf("-p \t play from \n"); printf("-s \t\t stereo\n"); @@ -45,6 +46,9 @@ int main(int argc,char **argv) { char play_file[MAX_C_FILE]; dsp_set set; unsigned char *buf; + unsigned char print_info=0; + unsigned char info[8]; + int info_int; /* defaults */ strcpy(device,""); @@ -59,6 +63,9 @@ int main(int argc,char **argv) { case 'h': usage(); return 1; + case 'i': + print_info=1; + break; case 'r': mode=RECORD; strcpy(record_file,argv[++i]); @@ -119,6 +126,33 @@ int main(int argc,char **argv) { } } + if(print_info) { + if(mode&PLAY) { + printf("file info:\n"); + lseek(pfile_fd,4,SEEK_SET); + read(pfile_fd,&info_int,4); + printf("file size: %d\n",info_int); + lseek(pfile_fd,8,SEEK_CUR); + read(pfile_fd,&info_int,4); + printf("fmtsize: %d\n",info_int); + read(pfile_fd,&info_int,4); + printf("format tag: %d\n",(info_int>>16)&1<<16); + printf("channels: %d\n",info_int&1<<16); + read(pfile_fd,&info_int,4); + printf("samples/sec: %d\n",info_int); + read(pfile_fd,&info_int,4); + printf("bytes/sec: %d\n",info_int); + read(pfile_fd,&info_int,4); + printf("block allign: %d\n",(info_int>>16)&1<<16); + printf("bits/sample: %d\n",info_int&1<<16); + lseek(pfile_fd,4,SEEK_CUR); + read(pfile_fd,&info_int,4); + printf("datasize: %d\n\n",info_int); + /* return to start */ + lseek(pfile_fd,0,SEEK_SET); + } + } + /* set dsp and get capabilities */ if(get_dsp_cap(audio_fd,&set,1)==-1) { printf("unable to get capabilities :(\n"); @@ -135,7 +169,7 @@ int main(int argc,char **argv) { perror("malloc"); return -1; } - + if(mode&PLAY) { printf("playing file %s ...\n",play_file); rw=1; -- 2.39.2