wave_fmt.h
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:4k
源码类别:

DVD

开发平台:

C/C++

  1. #ifndef __WAVE_FMT_H
  2. #define __WAVE_FMT_H
  3. #include "types.h"
  4. // wFormatTag definitions in mmreg.h
  5. #define WAVE_FORMAT_UNKNOWN 0x0000
  6. #define WAVE_FORMAT_PCM 0x0001
  7. #define WAVE_FORMAT_ADPCM 0x0002
  8. #define WAVE_FORMAT_IEEE_FLOAT 0x0003
  9. #define WAVE_FORMAT_G723_ADPCM 0x0014
  10. #define WAVE_FORMAT_G721_ADPCM 0x0040
  11. #define WAVE_FORMAT_G728_CELP 0x0041
  12. #define WAVE_FORMAT_G726_ADPCM 0x0064
  13. #define WAVE_FORMAT_DOLBY_AC2 0x0030
  14. #define WAVE_FORMAT_DOLBY_AC3 0x2000
  15. #define WAVE_FORMAT_DOLBY_DTS 0x2001
  16. #define WAVE_FORMAT_MPEG 0x0050
  17. #define WAVE_FORMAT_MPEGLAYER3 0x0055
  18. #define WAVE_FORMAT_WMA_OLD 0x0160 // WMA version type 1, not supported any more ->ycchou
  19. #define WAVE_FORMAT_WMA_STEREO 0x0161 // could be supported, version 7, 8, 9
  20. #define WAVE_FORMAT_WMA_PRO 0x0162
  21. #define WAVE_FORMAT_WMA_LOSSLESS 0x0163
  22. #define WAVE_FORMAT_WMA_VOICE 0x000A
  23. #define WAVE_FORMAT_NEC_AAC 0x00B0 // NEC AAC
  24. #define WAVE_FORMAT_MPEG2AAC 0x0180 // MP2 AAC
  25. #define WAVE_FORMAT_DIVIO_AAC 0x4143 // DIVIO AAC
  26. #define WAVE_FORMAT_AAC 0xa106 // MP4 AAC
  27. // proprietary wma header
  28. typedef struct _wmaheader
  29. {
  30. UINT16 wFormatTag;
  31. UINT32 dwSampRate;
  32. UINT32 dwBytePerSec;
  33. UINT16 wBlockAlign;
  34. UINT16 wReserve1; // nChannels+nBitsPerSample
  35. UINT32 dwSampPerBlk;
  36. UINT16 wEncOption;
  37. UINT16 wTag;
  38. } WMAHEADER;
  39. typedef struct tWAVEFORMATEX
  40. {
  41.     UINT16 wFormatTag       __attribute__ ((packed));   /* format type */
  42.     UINT16 nChannels        __attribute__ ((packed));   /* number of channels (i.e. mono, stereo...) */
  43.     UINT32 nSamplesPerSec   __attribute__ ((packed));   /* sample rate */
  44.     UINT32 nAvgBytesPerSec  __attribute__ ((packed));   /* for buffer estimation */
  45.     UINT16 nBlockAlign      __attribute__ ((packed));   /* block size of data */
  46.     UINT16 wBitsPerSample   __attribute__ ((packed));   /* Number of bits per sample of mono data */
  47.     UINT16 cbSize           __attribute__ ((packed));   /* The count in bytes of the size of extra information (after cbSize) */
  48. } WAVEFORMATEX;
  49. typedef struct tWMAUDIO2WAVEFORMAT
  50. {
  51.     WAVEFORMATEX wfx                __attribute__ ((packed));
  52.     UINT32      dwSamplesPerBlock   __attribute__ ((packed));
  53.     UINT16      wEncodeOptions      __attribute__ ((packed));
  54.     UINT32      dwSuperBlockAlign   __attribute__ ((packed));
  55. }   WMAUDIO2WAVEFORMAT;
  56. typedef struct mpeg1waveformat_tag {
  57.     WAVEFORMATEX    wfx __attribute__ ((packed));
  58.     UINT16            fwHeadLayer __attribute__ ((packed));
  59.     UINT32           dwHeadBitrate __attribute__ ((packed));
  60.     UINT16            fwHeadMode __attribute__ ((packed));
  61.     UINT16            fwHeadModeExt __attribute__ ((packed));
  62.     UINT16            wHeadEmphasis __attribute__ ((packed));
  63.     UINT16            fwHeadFlags __attribute__ ((packed));
  64.     UINT32           dwPTSLow __attribute__ ((packed));
  65.     UINT32           dwPTSHigh __attribute__ ((packed));
  66. } MPEG1WAVEFORMAT;
  67. typedef struct mpeglayer3waveformat_tag {
  68.   WAVEFORMATEX  wfx __attribute__ ((packed));
  69.   UINT16          wID __attribute__ ((packed));
  70.   UINT32         fdwFlags __attribute__ ((packed));
  71.   UINT16          nBlockSize __attribute__ ((packed));
  72.   UINT16          nFramesPerBlock __attribute__ ((packed));
  73.   UINT16          nCodecDelay __attribute__ ((packed));
  74. } MPEGLAYER3WAVEFORMAT;
  75. typedef struct tWAVFORMATMACRO
  76. {
  77.     WAVEFORMATEX    wfx             __attribute__ ((packed));
  78.     UINT8           reserve[30]     __attribute__ ((packed));
  79. }   WAVFORMATMACRO;
  80. #endif      // __WAVE_FMT_H