Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #ifdef __cplusplus
  2. extern "C" {
  3. #endif
  4.  
  5. #define MP3_ERROR_UNKNOWN                               1
  6. #define MP3_ERROR_INVALID_PARAMETER             2
  7. #define MP3_ERROR_INVALID_SYNC                  3
  8. #define MP3_ERROR_INVALID_HEADER                4
  9. #define MP3_ERROR_OUT_OF_BUFFER                 5
  10.  
  11. typedef struct {
  12.         int                     version;                //1:MPEG-1, 2:MPEG-2, 3:MPEG-2.5
  13.         int                     layer;                  //1:Layer1, 2:Layer2, 3:Layer3
  14.         int                     error_prot;             //1:CRC on, 0:CRC off
  15.         int                     br_index;
  16.         int                     fr_index;
  17.         int                     padding;
  18.         int                     extension;
  19.         int                     mode;
  20.         int                     mode_ext;
  21.         int                     copyright;
  22.         int                     original;
  23.         int                     emphasis;
  24. } MPEG_HEADER;
  25.  
  26. typedef struct {
  27.         int                     reduction;
  28.         int                     convert;
  29.         int                     freqLimit;
  30. } MPEG_DECODE_OPTION;
  31.  
  32. typedef struct {
  33.         MPEG_HEADER     header;
  34.         int                     channels;               //o—̓`ƒƒƒlƒ‹
  35.         int                     bitsPerSample;  //
  36.         int                     frequency;              //ƒTƒ“ƒvƒŠƒ“ƒOƒŒ[ƒgiHzj
  37.         int                     bitRate;                //ƒrƒbƒgƒŒ[ƒgibpsj
  38.  
  39.         int                     frames;                 //ƒtƒŒ[ƒ€”iVBR onlyj
  40.         int                     skipSize;               //iVBR onlyj
  41.         int                     dataSize;               //ƒf[ƒ^ƒTƒCƒYiVBR onlyj
  42.  
  43.         int                     minInputSize;   //1ƒtƒŒ[ƒ€‚̍ŏ¬“ü—̓TƒCƒY
  44.         int                     maxInputSize;   //1ƒtƒŒ[ƒ€‚̍őå“ü—̓TƒCƒY
  45.         int                     outputSize;             //1ƒtƒŒ[ƒ€‚̏o—̓TƒCƒY
  46. } MPEG_DECODE_INFO;
  47.  
  48. typedef struct {
  49.         MPEG_HEADER     header;
  50.         int                     bitRate;                //ƒrƒbƒgƒŒ[ƒgibpsj
  51.  
  52.         void*           inputBuf;
  53.         int                     inputSize;
  54.         void*           outputBuf;
  55.         int                     outputSize;
  56. } MPEG_DECODE_PARAM;
  57.  
  58. void mp3DecodeInit();
  59. int mp3GetLastError();
  60. int mp3SetDecodeOption(MPEG_DECODE_OPTION* option);
  61. void mp3GetDecodeOption(MPEG_DECODE_OPTION* option);
  62. int mp3SetEqualizer(int* value);
  63.  
  64. int mp3FindSync(void* buf, int size, int* sync);
  65. int mp3GetDecodeInfo(void* mpeg, int size, MPEG_DECODE_INFO* info, int decFlag);
  66. int mp3DecodeStart(void* buf, int size);
  67. int mp3DecodeFrame(MPEG_DECODE_PARAM* param);
  68.  
  69. void mp3MuteStart(MPEG_DECODE_PARAM* param);
  70. void mp3MuteEnd(MPEG_DECODE_PARAM* param);
  71.  
  72.         double pow_test(double, double);
  73.  
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77.