12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #pragma once
- //wav头的结构如下所示:
- typedef struct __WAV_HEADER{
- char fccID[4]; /* should be "RIFF" */
- unsigned long dwSize; /* byte_number behind it */
- char fccType[4]; /* should be "WAVE" */
- }HEADER;
- typedef struct __WAV_FMT{
- char fccID[4]; /* should be "fmt " */
- unsigned long dwSize; /* should be 0x10 */
- unsigned short wFormatTag; /* should be 1 */
- unsigned short wChannels; //| 声道数目,1--单声道;2--双声道 | |
- unsigned long dwSamplesPerSec; //采样频率
- unsigned long dwAvgBytesPerSec; //每秒所需字节数
- unsigned short wBlockAlign; //数据块对齐单位(每个采样需要的字节数)
- unsigned short uiBitsPerSample; //每个采样需要的bit数
- //unsigned char ExInfo[2]; //附加信息(可选,通过Size来判断有无)
- }FMT;
- typedef struct __WAV_DATA{
- char fccID[4]; /* should be "data" */
- unsigned long dwSize; /* byte_number of PCM data in byte*/
- }DATA;
- typedef struct{
- DWORD dwRIFF;
- DWORD dwFileLen;
- DWORD dwWAVE;
- DWORD dw_fmt;
- DWORD dwFmtLen;
- WORD wDataType;
- WORD wNChannels;
- DWORD dwSamplingRate;
- DWORD dwNBytesPerSec;
- WORD wAlignment;
- WORD wNBitsPerSam;
- DWORD dwdata;
- DWORD dwDataLen;
- }WAVEHEADER;
- extern int PcmToALow(char *pSrcFileName, char *pDescFileName);
|