wavFormat.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:2k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* wavFormat.h - WAV audio file format */
  2. /* Copyright 2000 Wind River Systems, Inc. */
  3. /*
  4. Modification history
  5. --------------------
  6. 01a,14jan00,rcb  First.
  7. */
  8. #ifndef __INCwavFormath
  9. #define __INCwavFormath
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /* RIFF file header */
  14. #define RIFF_HDR_SIG "RIFF"
  15. #define RIFF_HDR_SIG_LEN 4
  16. typedef struct riff_hdr 
  17.     {
  18.     char signature [4];      /* identifier string = "RIFF" */
  19.     UINT32 length;     /* remaining length after this header */
  20.     } RIFF_HDR, *pRIFF_HDR;
  21. /* RIFF .wav file signature */
  22. #define RIFF_WAV_DATA_SIG "WAVE"
  23. #define RIFF_WAV_DATA_SIG_LEN 4
  24. /* RIFF chunk header */
  25. #define RIFF_CHUNK_ID_LEN 4
  26. typedef struct riff_chunk_hdr 
  27.     {
  28.     char chunkId [RIFF_CHUNK_ID_LEN]; /* ID of chunk */
  29.     UINT32 length;     /* remaining length after header */
  30.     } RIFF_CHUNK_HDR, *pRIFF_CHUNK_HDR;
  31. /* .wav format chunk */
  32. #define RIFF_WAV_FMT_CHUNK_ID "fmt "
  33. typedef struct wav_format_chunk 
  34.     {
  35.     UINT16 formatTag;     /* format category */
  36.     UINT16 channels;     /* number of channels */
  37.     UINT32 samplesPerSec;     /* sampling rate */
  38.     UINT32 avgBytesPerSec;     /* used to estminate bfr requirements */
  39.     UINT16 blockAlign;     /* data block size */
  40.     union 
  41. {
  42. struct     /* MS PCM-specific data */
  43.     {     
  44.     UINT16 bitsPerSample;   /* sample size */
  45.     } msPcm;
  46. } fmt;
  47.     } WAV_FORMAT_CHUNK, *pWAV_FORMAT_CHUNK;
  48. /* .wav format categories */
  49. #define WAV_FMT_MS_PCM     0x0001  /* Microsoft PCM */
  50. #define WAV_FMT_IBM_MULAW   0x0101  /* IBM mul-law */
  51. #define WAV_FMT_IBM_ALAW    0x0102  /* IBM a-law */
  52. #define WAV_FMT_IBM_ADPCM   0x0103  /* IBM AVC ADPCM */
  53. /* data chunk */
  54. #define RIFF_WAV_DATA_CHUNK_SIG "data"
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58. #endif /* __INCwavFormath */
  59. /* End of file. */