| 发表于:2007-03-19 16:49:253楼 得分:0 |
不需要mmcontrol, 直接用api函数mcisendstring就行了: private declare function mcisendstring lib "winmm.dll " alias "mcisendstringa " _ (byval lpstrcommand as string, byval lpstrreturnstring as string, _ byval ureturnlength as long, byval hwndcallback as long) as long private sub command1_click() '开始录音 dim iret as long iret = mcisendstring( "open new type waveaudio alias myrecord ", 0&, 0, 0) iret = mcisendstring( "set myrecord bitspersample 16 samplespersec 16384 ", 0&, 0, 0) iret = mcisendstring( "record myrecord overwrite ", 0&, 0, 0) end sub private sub command2_click() '保存录音 dim iret as long iret = mcisendstring( "save myrecord c:\1.wav ", 0&, 0, 0) iret = mcisendstring( "close myrecord ", 0&, 0, 0) end sub | | |
|