有关于用声卡模拟数据采集卡采集数据数据给我全部分(破产求助!!急!!!!!!)(200分)

  • 主题发起人 主题发起人 物理
  • 开始时间 开始时间

物理

Unregistered / Unconfirmed
GUEST, unregistred user!
最近在做一个用声卡模拟数据采集卡做一个采集分析器,用一些WAVEIN**
函数,有关其中的一些关键技术掌握不够,恳请各位专家不吝赐教
var
Form1: TForm1;
pqWAVEHDR:pWAVEHDR;
pqphwavein:PHWAVEIN;
pqWAVEFORMATEX:pWAVEFORMATex;
qWAVEFORMATEX:tWAVEFORMATex;
qhwavein:hwavein;
qwavehdr:wavehdr;
pwic:pwaveincaps;
cbwic:waveincaps;
implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);

begin

// panel1.Caption:=inttostr(mmsystemGetVersion);
panel1.caption:=inttostr(waveInOpen(pqphwavein,WAVE_MAPPER ,pqWAVEFORMATEX,0,0,WAVE_MAPPED ));
end;

procedure TForm1.Button2Click(Sender: TObject);

begin

panel1.Caption:=inttostr(qWAVEFORMATEX.wFormatTag);
end;


procedure TForm1.FormCreate(Sender: TObject);
// var mystring:form1.Memo1.Lines;
begin

memo1.Text:=form1.Memo1.Lines.Text;
//错误代码对应
//lphwavein:=0;
//with WAVEFORMATEXdo

//begin

qWAVEFORMATEX.wFormatTag:=WAVE_FORMAT_PCM;//定义WAVEFORMAT结构
qWAVEFORMATEX.nChannels:=0;
qWAVEFORMATEX.nSamplesPerSec:=WAVE_FORMAT_4S16;
qWAVEFORMATEX.nAvgBytesPerSec:=WAVE_FORMAT_4S16*qWAVEFORMATEX.nBlockAlign;
qWAVEFORMATEX.nBlockAlign:=2*2;
panel1.caption:=inttostr(waveInOpen(pqphwavein,WAVE_MAPPER ,pqWAVEFORMATEX,0,0,WAVE_MAPPED ));
//qwaveformatex.wBitsPerSample:=16;
//qwaveformatex.cbSize:=0;
//end;

with qwavehdrdo
//定义WAVEHDR结构
begin

//lpdata:=pqwavehdr;
dwbufferlength:=2000;
dwBytesRecorded:=1000;
end;

end;


procedure TForm1.Button3Click(Sender: TObject);

begin

waveInOpen(pqphwavein,WAVE_MAPPER,pqWAVEFORMATEX,0,0,WAVE_FORMAT_QUERY)
panel1.caption:=inttostr(waveInAddBuffer(waveInGetNumDevs,pqWAVEHDR ,100));
//panel1.caption:=inttostr(wavehdr.dwBufferLength );
end;




procedure TForm1.Button4Click(Sender: TObject);
begin

panel1.caption:=inttostr(waveinstart(qhwavein));

end;


procedure TForm1.Button5Click(Sender: TObject);
begin

panel1.caption:=inttostr(waveInPrepareHeader(qhwavein,pqwavehdr,2000));
end;


procedure TForm1.Button6Click(Sender: TObject);
begin

//panel1.caption:=inttostr(waveInGetDevCaps(WAVE_MAPPER,pwaveincaps,sizeof(cbwic)));
panel1.caption:=inttostr(WAVE_MAPPER);
end;


end.

运行有问题
主要是内存的,有兴趣的和我探讨
E_MAIL: tju_2001@eyou.com
 
看看我发的一个帖子!
有人给了一些意见!
 
如何在录音时实时得得到wave数据!最好是用audio控件实现的!分不够再加!!!
 
mmtools 最简单.了 xwings@263.net
 
同意xwings,用mmtools的确很简单
 
多人接受答案了。
 
后退
顶部