-
Asynchronous sounds...
I am using the following code:
Code:
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Const SND_ASYNC As Long = &H1
Public Sub Command1_Click()
PlaySound "SystemExclamation", 0&, SND_ASYNC
End Sub
Public Sub Command2_Click()
PlaySound "SystemExit", 0&, SND_ASYNC
End Sub
I can't get it to play the two sounds at the same time..
I click command2, then I quickly click command1, and it stops 2 automatically....
How can I get them both playing at the same time?
Thanks, :)
-
They can't play at the same time because of device contention.
Once a sound starts playing the thread playing it 'owns' the sound card, for instance.
-
Well you can play multiple sounds at the same time, at least in different applications. I can be playing mp3s through winamp, test playing a sound from the sound thing in the control panel, and run the code you posted and have all three playing at the sametime.
Of course I'm not sure how you do this in VB, maybe research on using DirectSound.
-
well, I 'spose winamp is probably using DirectSound, but is there an easy way to add this to my app.
It isn't extremely important, but I think it would make it sound better.. :)
BTW: Anyone got any links to free sound FX sites?
Thanks, :)
-
I need car alarm arming & disarming sounds!!
Help is good :D
Thanks, :)
-
Can't help with the DirectSound issue although I'm sure a search on Google will come up with something, but as for a sounds site here is one:
http://wavcentral.com/
-
1 Attachment(s)
Sounds
Here are the sounds, they work great for a password protected program. I use them sometimes
-
To have two or more different sounds play at the same time, the most effective, though not the most efficient, way is to load two or more instances of the Windows Media Player control, and play the sound files.
If the souds you are playing are just System Feedback sounds, system overhead in using two to four MPlayer controls should not be an issue.
-
thanks for the site!
(just looking through it for my sounds!)
anyone else got car alarm (arming & dis-arming) sounds??
I need them for my app!!
Also, how can I send a file (errlog.txt) to my email ([email protected]) through vb?
My friend suggests shelling a VB Script file, but I'm not sure what he meant by that. Anyway hes gone away for a few days, and I would like to know more on the issue.
Thanks for all your help so far, :)