trunk 20080912
[gitenigma.git] / include / lib / codecs / codecmp3.h
blob9402bbae4d656d7b1dc3b495102e0b15e7f4fba5
1 #ifndef DISABLE_FILE
3 #ifndef __lib_codecs_codecmp3_h
4 #define __lib_codecs_codecmp3_h
6 #include <mad.h>
7 #include <lib/codecs/codec.h>
9 class eAudioDecoderMP3: public eAudioDecoder
11 enum { INPUT_BUFFER_SIZE=8192 };
12 unsigned char input_buffer[INPUT_BUFFER_SIZE];
13 int avgbr; // average bitrate
15 int framecnt;
17 mad_stream stream;
18 mad_frame frame;
19 mad_synth synth;
20 mad_timer_t timer;
21 eIOBuffer &input, &output;
22 public:
23 eAudioDecoderMP3(eIOBuffer &input, eIOBuffer &output);
24 ~eAudioDecoderMP3();
26 void resync();
27 int getMinimumFramelength();
28 int decodeMore(int last, int maxsamples, Signal1<void, unsigned int>*cb=0);
29 int getAverageBitrate();
32 #endif
34 #endif //DISABLE_FILE