![]() |
其实语音监控比较简单~这里给出简单代码! |
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. |