Mercurial > SDL_sound_CoreAudio
comparison 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 |
comparison
equal
deleted
inserted
replaced
260:44a4730a1e6f | 261:9b6e82f7c853 |
---|---|
1 | |
2 #include "mpg123_sdlsound.h" | |
3 #include "mpglib_sdlsound.h" | |
4 | |
5 #error This is for example usage. Do not compile for SDL_sound. | |
6 | |
7 char buf[16384]; | |
8 struct mpstr mp; | |
9 | |
10 int main(int argc,char **argv) | |
11 { | |
12 int size; | |
13 char out[8192]; | |
14 int len,ret; | |
15 | |
16 | |
17 InitMP3(&mp); | |
18 | |
19 while(1) { | |
20 len = read(0,buf,16384); | |
21 if(len <= 0) | |
22 break; | |
23 ret = decodeMP3(&mp,buf,len,out,8192,&size); | |
24 while(ret == MP3_OK) { | |
25 write(1,out,size); | |
26 ret = decodeMP3(&mp,NULL,0,out,8192,&size); | |
27 } | |
28 } | |
29 | |
30 return 0; | |
31 | |
32 } | |
33 |