vb如何用api录音保存为wav?
http://bbs.csdn.net/topics/10291998

解决方案 »

  1.   

    http://bbs.csdn.net/topics/50015346
      

  2.   

    http://blog.csdn.net/tanaya/article/details/33109
      

  3.   

    示例(Multimedia MCI 控件)
    Visual Basic 示例下面的示例演示了打开一台使用兼容数据文件的 MCI 设备的过程。将这些代码放到 Form_Load 过程,应用程序就可以使用 Multimedia MCI 控件来对文件 Gong.wav 进行 播放、记录和倒带。在试运行这个示例之前,首先应创建一个包含 Multimedia MCI 控件的窗体。Private Sub Form_Load () 
       ' Set properties needed by MCI to open.
       MMControl1.Notify = FALSE
       MMControl1.Wait = TRUE
       MMControl1.Shareable = FALSE
       MMControl1.DeviceType = "WaveAudio"
       MMControl1.FileName = "C:\WINDOWS\MMDATA\GONG.WAV"   '打开 MCI WaveAudio 设备。
       MMControl1.Command = "Open"
    End Sub为了正确管理多媒体资源,在退出应用程序之前,应该关闭那些已经打开的 MCI 设备。将下面的语句放到 Form_Unload 过程,那么在退出包含 Multimedia MCI 控件的窗体之前,就可以关闭那些已经打开的 MCI 设备。Private Sub Form_Unload (Cancel As Integer)
       MMControl1.Command = "Close"
    End Sub
      

  4.   

    record
    The record command starts recording data. VCR and waveform-audio devices recognize this command. Although digital-video devices and MIDI sequencers also recognize this command, the MCIAVI and MCISEQ drivers do not implement it.wsprintf(lpstrCommand, "record %s %s %s", lpszDeviceID, lpszRecordFlags, 
        lpszFlags); 
     
    Parameters
    lpszDeviceID 
    Identifier of an MCI device. This identifier or alias is assigned when the device is opened. 
    lpszRecordFlags 
    Flag for recording data. The following table lists device types that recognize the record command and the flags used by each type: digitalvideo at rectangle
    audio stream stream
    from position
    hold insert
    overwrite
    to position
    video stream stream 
    sequencer from position
    insert overwrite
    to position 
    vcr at time
    from position
    initialize insert
    overwrite
    to position 
    waveaudio from position
    insert overwrite
    to position 
    The following table lists the flags that can be specified in the lpszRecordFlags parameter and their meanings: at rectangle Specifies a rectangular region of the external input used as the source for the pixels compressed and saved. If not specified, the rectangle defaults to the rectangle specified for put "video". When it is set differently from the "video" rectangle, the displayed image is not what is recorded. 
    at time Indicates when the device should begin performing this command, or, if the device has been cued, when the cued command begins. For more information, see the cue command. 
    audio stream stream Specifies the audio stream used for recording. If this flag is not specified and the file format does not define a default, it is recorded into the stream that is physically first. 
    from position Specifies a starting position for the recording. If the "from" flag is not specified, the device starts recording at the current position. 
    hold Freezes the image when recording has finished instead of showing live video. When recording stops, an automatic monitor "file" command is performed. To return to live video, issue the monitor "input" command. 
    initialize Initialize the tape (media), which involves recording timecode (if possible) for blank video and audio. This command might take several hours if the entire tape must be initialized. 
    insert Specifies that new data is added to the file at the current position. 
    overwrite Specifies that new data will replace data in the file. 
    to position Specifies an ending position for the recording. If the "to" flag is not specified, the device records until it receives a stop or pause command. 
    video stream stream Specifies the video stream used for recording. If this is not specified and the file format does not define a default, then it is recorded into the stream that is physically first. lpszFlags 
    Can be "wait", "notify", or both. For digital-video and VCR devices, "test" can also be specified. For more information about these flags, see The Wait, Notify, and Test Flags. 
    Return Values
    Returns zero if successful or an error otherwise.Res
    The recording stops when a stop or pause command is issued. For the MCIWAVE driver, all data recorded after a file is opened is discarded if the file is closed without saving it.Before issuing any commands that use position values, you should set the desired time format by using the set command. The tracks to be recorded are specified by the settimecode "record", set "assemble record", setvideo "record", and setaudio "record" commands.The following command starts recording at the current position:record mysound
     
    QuickInfo
      Windows NT: Requires version 3.1 or later.
      Windows: Requires Windows 95 or later.
      Windows CE: Unsupported.See Also
    MCI Overview, MCI Command Strings, cue, monitor, pause, put, set, setaudio, settimecode, setvideo, stop  
      

  5.   

    http://blog.csdn.net/mengzhuanghua/article/details/5959688
      

  6.   

    一般也只能保存为WAV,比较大,如果能压缩成MP3更好,体积能小几倍