Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef _MP3DEC_H
00045 #define _MP3DEC_H
00046
00047 #if defined(_WIN32) && !defined(_WIN32_WCE)
00048 #
00049 #elif defined(_WIN32) && defined(_WIN32_WCE) && defined(ARM)
00050 #
00051 #elif defined(_WIN32) && defined(WINCE_EMULATOR)
00052 #
00053 #elif defined(ARM_ADS)
00054 #
00055 #elif defined(_SYMBIAN) && defined(__WINS__)
00056 #
00057 #elif defined(__GNUC__) && defined(__arm__)
00058 #
00059 #elif defined(__GNUC__) && defined(__i386__)
00060 #
00061 #elif defined(_OPENWAVE_SIMULATOR) || defined(_OPENWAVE_ARMULATOR)
00062 #
00063 #else
00064 #error No platform defined. See valid options in mp3dec.h
00065 #endif
00066
00067 #ifdef __cplusplus
00068 extern "C" {
00069 #endif
00070
00071
00072
00073
00074
00075
00076 #ifndef MAINBUF_SIZE
00077 #define MAINBUF_SIZE 1940
00078 #endif
00079
00080 #define MAX_NGRAN 2
00081
00082 #ifndef MAX_NCHAN
00083 #define MAX_NCHAN 2
00084 #endif
00085
00086 #define MAX_NSAMP 576
00087
00088
00089 typedef enum {
00090 MPEG1 = 0,
00091 MPEG2 = 1,
00092 MPEG25 = 2
00093 } MPEGVersion;
00094
00095 typedef void *HMP3Decoder;
00096
00097 enum {
00098 ERR_MP3_NONE = 0,
00099 ERR_MP3_INDATA_UNDERFLOW = -1,
00100 ERR_MP3_MAINDATA_UNDERFLOW = -2,
00101 ERR_MP3_FREE_BITRATE_SYNC = -3,
00102 ERR_MP3_OUT_OF_MEMORY = -4,
00103 ERR_MP3_NULL_POINTER = -5,
00104 ERR_MP3_INVALID_FRAMEHEADER = -6,
00105 ERR_MP3_INVALID_SIDEINFO = -7,
00106 ERR_MP3_INVALID_SCALEFACT = -8,
00107 ERR_MP3_INVALID_HUFFCODES = -9,
00108
00109 ERR_UNKNOWN = -9999
00110 };
00111
00112 typedef struct _MP3FrameInfo {
00113 int bitrate;
00114 int nChans;
00115 int samprate;
00116 int bitsPerSample;
00117 int outputSamps;
00118 int layer;
00119 int version;
00120 } MP3FrameInfo;
00121
00122
00123 HMP3Decoder MP3InitDecoder(void);
00124 void MP3FreeDecoder(HMP3Decoder hMP3Decoder);
00125 int MP3Decode(HMP3Decoder hMP3Decoder, unsigned char **inbuf, int *bytesLeft, short *outbuf, int useSize);
00126
00127 void MP3GetLastFrameInfo(HMP3Decoder hMP3Decoder, MP3FrameInfo *mp3FrameInfo);
00128 int MP3GetNextFrameInfo(HMP3Decoder hMP3Decoder, MP3FrameInfo *mp3FrameInfo, unsigned char *buf);
00129 int MP3FindSyncWord(unsigned char *buf, int nBytes);
00130
00131 #ifdef __cplusplus
00132 }
00133 #endif
00134
00135 #endif