WAVE文件的头文件定义,谁能给解释一下,送分!
以下是WAVE文件的头文件定义,谁能给详细的说明一下各个参数都表示什么?还有WAVE文件的音频数据长度属性是哪个参数,在文件中第几个字节?
{
typedef struct _TWavHeader
{
long rId;
long rLen;
long wId;
long fId;
long fLen;
WORD wFormatTag;
WORD nChannels;
long nSamplesPerSec;
long nAvgBytesPerSec;
WORD nBlockAlign;
WORD wBitsPerSample;
long dId;
long wSampleLength;
}TWavHeader;
TWavHeader wh;
wh.rId = 0x46464952;
wh.rLen = 36;
wh.wId = 0x45564157;
wh.fId = 0x20746d66;
wh.fLen = 16;
wh.wFormatTag = 1;
wh.nChannels = wChannels;
wh.nSamplesPerSec = lRate;
wh.nAvgBytesPerSec = wChannels * lRate * (wResolution / 8);
wh.nBlockAlign = wChannels * (wResolution / 8);
wh.wBitsPerSample = wResolution;
wh.dId = 0x61746164;
wh.wSampleLength = 0;
int nHandle = FileCreate(strFileName);
FileSeek(nHandle, 0, 0);
FileWrite(nHandle, &wh, sizeof(wh));
FileClose(nHandle);
}