Results 1 to 2 of 2

Thread: recording sound

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    u.s.a
    Posts
    127

    Post

    Is there a quick way of recording a .wav file via VB.
    I know how to play a wav file using the API call sndPlaySound, but I'm not sure if API is possible or the best solution.
    Is the multimedia component a better and possible solution??
    Thanks.
    Dan.

  2. #2
    Lively Member
    Join Date
    Oct 1999
    Posts
    101

    Post

    Hi Dan.

    Here's how to do it!

    Create a new VB project. Add a multimedia control ("Project...Components...M$ Multimedia Control") and a command button to the form.

    In the properties for the Multimedia control, be sure that PlayEnabled, PlayVisible, PrevEnabled, PrevVisible, RecordEnabled and RecordVisible are all set to TRUE.

    Go to the VB Editor and paste this code:

    Code:
    Option Explicit
    
    Private Sub Command1_Click()
        End 'the program
    End Sub
    
    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:\test3.wav"
    
        ' Open the MCI WaveAudio device.
        MMControl1.Command = "Open"
    End Sub
    Now run the program.

    Click on the Round button (record) to make a new recording. Click on the rewind button and then the play button to hear the recorded file.

    All the best.

    Chris

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width