# HG changeset patch # User arpi_esp # Date 990051793 0 # Node ID 13805b1ca0f76ea3f548008257e8760e0f6c66ac # Parent a8c862627dc3cf256ca1cf17d0e327bedc8d86e3 dump to file diff -r a8c862627dc3 -r 13805b1ca0f7 mp3lib/test.c --- a/mp3lib/test.c Wed May 16 20:07:22 2001 +0000 +++ b/mp3lib/test.c Wed May 16 22:23:13 2001 +0000 @@ -1,3 +1,5 @@ + +#define DUMP_PCM // gcc test.c -I.. -L. -lMP3 -o test -O4 @@ -33,6 +35,10 @@ int total=0; unsigned int time1; float length; +#ifdef DUMP_PCM + FILE *f=NULL; + f=fopen("test.pcm","wb"); +#endif mp3file=fopen((argc>1)?argv[1]:"test.mp3","rb"); if(!mp3file){ printf("file not found\n"); exit(1); } @@ -46,9 +52,12 @@ MP3_samplerate=MP3_channels=0; time1=GetTimer(); - while((len=MP3_DecodeFrame(buffer,-1))>0){ + while((len=MP3_DecodeFrame(buffer,-1))>0 && total<2000000){ total+=len; // play it +#ifdef DUMP_PCM + fwrite(buffer,len,1,f); +#endif //putchar('.');fflush(stdout); } time1=GetTimer()-time1;