|
-
Jan 10th, 2000, 11:39 PM
#1
Thread Starter
Lively Member
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.
-
Jan 11th, 2000, 02:53 AM
#2
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|