Guidance
指路人
g.yi.org
software / rapidq / Examples / Audio & Video / record.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
' How to record a wav file
' Thanks to Dave Navarro for this code:

     DECLARE FUNCTION mciSendString LIB "WINMM.DLL" ALIAS "mciSendStringA" _
      (StrCommand AS STRING, ReturnString AS LONG, _
      ReturnLength AS LONG, hwndCallBack AS LONG) AS INTEGER

     mciSendString "open new Type waveaudio Alias capture", 0, 0, 0
     mciSendString "set capture bitspersample 8", 0, 0, 0
     mciSendString "set capture samplespersec 11025", 0, 0, 0
     mciSendString "set capture channels 1", 0, 0, 0
     mciSendString "record capture", 0, 0, 0
     PRINT "Press any key to stop recording..."

     DO
     LOOP UNTIL LEN(INKEY$)

    'bitspersample can be:
    '8
    '16
    '
    'samplespersec can be:
    '11025
    '22050
    '44100
    '
    'channels can be:
    ' 1 = mono
    ' 2 = stereo

     mciSendString "stop capture", 0, 0, 0
     mciSendString "save capture NewWave.wav", 0, 0, 0
     mciSendString "close capture", 0, 0, 0
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2024-5-30  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:40:29