forked from KolibriOS/kolibrios
77 lines
1.9 KiB
C
77 lines
1.9 KiB
C
|
#ifdef __cplusplus
|
|||
|
extern "C" {
|
|||
|
#endif
|
|||
|
|
|||
|
#define MP3_ERROR_UNKNOWN 1
|
|||
|
#define MP3_ERROR_INVALID_PARAMETER 2
|
|||
|
#define MP3_ERROR_INVALID_SYNC 3
|
|||
|
#define MP3_ERROR_INVALID_HEADER 4
|
|||
|
#define MP3_ERROR_OUT_OF_BUFFER 5
|
|||
|
|
|||
|
typedef struct {
|
|||
|
int version; //1:MPEG-1, 2:MPEG-2, 3:MPEG-2.5
|
|||
|
int layer; //1:Layer1, 2:Layer2, 3:Layer3
|
|||
|
int error_prot; //1:CRC on, 0:CRC off
|
|||
|
int br_index;
|
|||
|
int fr_index;
|
|||
|
int padding;
|
|||
|
int extension;
|
|||
|
int mode;
|
|||
|
int mode_ext;
|
|||
|
int copyright;
|
|||
|
int original;
|
|||
|
int emphasis;
|
|||
|
} MPEG_HEADER;
|
|||
|
|
|||
|
typedef struct {
|
|||
|
int reduction;
|
|||
|
int convert;
|
|||
|
int freqLimit;
|
|||
|
} MPEG_DECODE_OPTION;
|
|||
|
|
|||
|
typedef struct {
|
|||
|
MPEG_HEADER header;
|
|||
|
int channels; //<2F>o<EFBFBD>̓`<60><><EFBFBD>l<EFBFBD><6C>
|
|||
|
int bitsPerSample; //
|
|||
|
int frequency; //<2F>T<EFBFBD><54><EFBFBD>v<EFBFBD><76><EFBFBD><EFBFBD><EFBFBD>O<EFBFBD><4F><EFBFBD>[<5B>g<EFBFBD>iHz<48>j
|
|||
|
int bitRate; //<2F>r<EFBFBD>b<EFBFBD>g<EFBFBD><67><EFBFBD>[<5B>g<EFBFBD>ibps<70>j
|
|||
|
|
|||
|
int frames; //<2F>t<EFBFBD><74><EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD>iVBR only<6C>j
|
|||
|
int skipSize; //<2F>iVBR only<6C>j
|
|||
|
int dataSize; //<2F>f<EFBFBD>[<5B>^<5E>T<EFBFBD>C<EFBFBD>Y<EFBFBD>iVBR only<6C>j
|
|||
|
|
|||
|
int minInputSize; //1<>t<EFBFBD><74><EFBFBD>[<5B><><EFBFBD>̍ŏ<CC8D><C58F><EFBFBD><EFBFBD>̓T<CD83>C<EFBFBD>Y
|
|||
|
int maxInputSize; //1<>t<EFBFBD><74><EFBFBD>[<5B><><EFBFBD>̍ő<CC8D><C591><EFBFBD><EFBFBD>̓T<CD83>C<EFBFBD>Y
|
|||
|
int outputSize; //1<>t<EFBFBD><74><EFBFBD>[<5B><><EFBFBD>̏o<CC8F>̓T<CD83>C<EFBFBD>Y
|
|||
|
} MPEG_DECODE_INFO;
|
|||
|
|
|||
|
typedef struct {
|
|||
|
MPEG_HEADER header;
|
|||
|
int bitRate; //<2F>r<EFBFBD>b<EFBFBD>g<EFBFBD><67><EFBFBD>[<5B>g<EFBFBD>ibps<70>j
|
|||
|
|
|||
|
void* inputBuf;
|
|||
|
int inputSize;
|
|||
|
void* outputBuf;
|
|||
|
int outputSize;
|
|||
|
} MPEG_DECODE_PARAM;
|
|||
|
|
|||
|
void mp3DecodeInit();
|
|||
|
int mp3GetLastError();
|
|||
|
int mp3SetDecodeOption(MPEG_DECODE_OPTION* option);
|
|||
|
void mp3GetDecodeOption(MPEG_DECODE_OPTION* option);
|
|||
|
int mp3SetEqualizer(int* value);
|
|||
|
|
|||
|
int mp3FindSync(void* buf, int size, int* sync);
|
|||
|
int mp3GetDecodeInfo(void* mpeg, int size, MPEG_DECODE_INFO* info, int decFlag);
|
|||
|
int mp3DecodeStart(void* buf, int size);
|
|||
|
int mp3DecodeFrame(MPEG_DECODE_PARAM* param);
|
|||
|
|
|||
|
void mp3MuteStart(MPEG_DECODE_PARAM* param);
|
|||
|
void mp3MuteEnd(MPEG_DECODE_PARAM* param);
|
|||
|
|
|||
|
double pow_test(double, double);
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
}
|
|||
|
#endif
|