[819815]: src / libmpg123 / main.c  Maximize  Restore  History

Download this file

30 lines (21 with data), 372 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "mpg123.h"
#include "mpglib.h"
char buf[16384];
struct mpstr mp;
void main(void)
{
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);
}
}
}