当前位置:编程学习 > 网站相关 >>

语音监控简单代码

其实语音监控比较简单~这里给出简单代码!

program start;

uses
  windows,mmSystem;
procedure MyStartRecordSound();
begin

mciSendString(OPEN NEW TYPE WAVEAUDIO ALIAS mysound, nil, 0, 0);
mciSendString(SET mysound TIME FORMAT MS + // set time
BITSPERSAMPLE 8 + // 8 Bit
CHANNELS 1 + // MONO
SAMPLESPERSEC 8000 + // 8 KHz
BYTESPERSEC 8000, // 8000 Bytes/s
nil, 0, 0);
mciSendString(RECORD mysound, nil, 0, 0)

end;


procedure MyStropRecordSound();
begin
mciSendString(STOP mysound, nil, 0, 0)

end;


procedure MySaveRecordSound();
var
verz: String;
begin
GetDir(0, verz);
mciSendString(PChar(SAVE mysound + verz + /test.wav), nil, 0, 0);
mciSendString(CLOSE mysound, nil, 0, 0)
end;


begin

MyStartRecordSound;
sleep(5000);
MyStropRecordSound;
MySaveRecordSound;

end.

补充:综合编程 , 安全编程 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,