Hey Everyone....i was wondering what do i need to make wav. files ?? if this is possible? if not can you fill me in on how to get some?
Thanks :0)
NewBee Vbeer6.0()
Using VB6 PRO SP3 & 4
END SUB
Printable View
Hey Everyone....i was wondering what do i need to make wav. files ?? if this is possible? if not can you fill me in on how to get some?
Thanks :0)
NewBee Vbeer6.0()
Using VB6 PRO SP3 & 4
END SUB
Do you mean how to record wav files or create them binary?
If you mean how do you record a wav using an already made program, go to Start --> Programs --> Accessories --> Entertaintment --> Sound Recorder. You can record off of your microphone. If you want to record using your own progam in code, then here ya go:
'First you must delare this:
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
'To record use this:
i = mciSendString("open new Type waveaudio Alias capture", 0&, 0, 0)
i = mciSendString("set capture bitspersample 8", 0&, 0, 0)
i = mciSendString("set capture samplespersec 11025", 0&, 0, 0)
i = mciSendString("set capture channels 1", 0&, 0, 0)
i = mciSendString("record capture", 0&, 0, 0)
'bitspersample can be:
'8
'16
'
'samplespersec can be:
'11025
'22050
'44100
'
'channels can be:
' 1 = mono
' 2 = stereo
'To stop and save your wav file use this:
i = mciSendString("stop capture", 0&, 0, 0)
i = mciSendString("save capture c:\NewWave.wav", 0&, 0, 0)
'i = mciSendString("close capture", 0&, 0, 0)
'To play the wav, use this:
i = mciSendString("play capture from 0", 0&, 0, 0)
'Remember to put this in your forms QueryUnload or the wav will keep playing even when your form is closed.
i = mciSendString("close capture", 0&, 0, 0)
Hope that helps. If you have any questions, e-mail me at [email protected]
I Would also like to know where i can possibly downlaod wav.files..because i have a video game i am making in vb and i would like to have a gunshot/machinegun sound in my program..
Thanks.
NewBee Vbeer6.0()
Dabling in vb6 pro sp3&4
End Sub
Try altavista :)