Mercurial > SDL_sound_CoreAudio
diff decoders/mpglib/main.c @ 261:9b6e82f7c853
Initial add.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Thu, 21 Feb 2002 19:46:09 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/decoders/mpglib/main.c Thu Feb 21 19:46:09 2002 +0000 @@ -0,0 +1,33 @@ + +#include "mpg123_sdlsound.h" +#include "mpglib_sdlsound.h" + +#error This is for example usage. Do not compile for SDL_sound. + +char buf[16384]; +struct mpstr mp; + +int main(int argc,char **argv) +{ + int size; + char out[8192]; + int len,ret; + + + InitMP3(&mp); + + while(1) { + len = read(0,buf,16384); + if(len <= 0) + break; + ret = decodeMP3(&mp,buf,len,out,8192,&size); + while(ret == MP3_OK) { + write(1,out,size); + ret = decodeMP3(&mp,NULL,0,out,8192,&size); + } + } + + return 0; + +} +