不是,仅仅知道相关的api函数的使用方法,函数的使用顺序就可以了。要求不高,就
相当于数据采集吧!
函数我已用过一些了,以下是部分原程序:
if waveInGetNumDevs=0 then
begin
//
exit;
end;
pwaveFmt:=AllocMem(sizeof(TWAVEFORMATEX));
pwaveFmt^.wFormatTag:=WAVE_FORMAT_PCM;
pwaveFmt^.nChannels:=1;
pwaveFmt^.nSamplesPerSec:=SampleHz;
//If wFormatTag is WAVE_FORMAT_PCM, then
common values for nSamplesPerSec
//are 8.0 kHz, 11.025 kHz, 22.05 kHz, and 44.1 kHz.
pwaveFmt^.wBitsPerSample:=8;
//If wFormatTag is WAVE_FORMAT_PCM, then
wBitsPerSample should be equal
//to 8 or 16.
pwaveFmt^.nBlockAlign:=8;
//If wFormatTag is WAVE_FORMAT_PCM,equal to the product of nChannels
//and wBitsPerSample
pwaveFmt^.nAvgBytesPerSec:=SampleHz*8;
//If wFormatTag is WAVE_FORMAT_PCM, nAvgBytesPerSec should be equal to
//the product of nSamplesPerSec and nBlockAlign.
pwaveFmt^.cbSize:=0;
//Note that for WAVE_FORMAT_PCM formats (and only WAVE_FORMAT_PCM formats),
//this member is ignored.
tmp:=waveInOpen(@WaveIn,WAVE_MAPPER,pwaveFmt,DWORD(@audiocallback),0,
CALLBACK_FUNCTION);
//这一句总出错,提示地址冲突
不知是何原因?