|
-
Aug 13th, 2002, 05:07 PM
#1
Thread Starter
Addicted Member
Sound problem
Declare Function sndPlaySound Lib "winmm.dll" Alias _
"sndPlaySoundA" (ByVal lpszSoundName As String, ByVal _
uFlags As Long) As Long
Declare Function sndPlaySoundB Lib "winmm.dll" Alias _
"sndPlaySoundA" (ByVal lpszSoundName As String, ByVal _
uFlags As Long) As Long
I make declariations for two different sounds like this, then I play one sound:
Call sndPlaySound(App.Path & "\sound.wav", &H1 Or &H8)
Then later on in the game I play a different sound the same way except not looping, and the first sound interupts and no longer loops. How can I play two sounds at once. I have one sound that is looping and one sound that does not, it only plays sometimes. Please Help!
Thanks.
-
Aug 14th, 2002, 11:05 AM
#2
Addicted Member
Use DirectX's DirectSound.
-
Aug 15th, 2002, 11:31 AM
#3
Hyperactive Member
Machaira or anyone,
Could you help with code on "how" not on "what" to use to achive this. Others probably would like this answer also. Could you please post your DirectSound code?
Thanks
-
Aug 15th, 2002, 06:07 PM
#4
Addicted Member
-
Aug 17th, 2002, 01:10 AM
#5
Good Ol' Platypus
The reason for this is SndPlaySound (now depricated apparently) can't mix waves. Before Win98 we had to use WaveMix.dll for this purpose, but it's easier and faster now to use DirectSound. So look at http://www.directx4vb.com/ in all of its horrible-new-layout glory, and go to the DirectX8 - DirectAudio section. You should find playing Wave files there-- and you can also, quite easily, play any media for which there is a codec for on the system (in other words, any media you can play in wmplayer).
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Aug 17th, 2002, 10:30 AM
#6
Thread Starter
Addicted Member
Thanks, but I already know how to use DX. My game has to be in pure VB.
THanks anyways.
-
Aug 17th, 2002, 02:22 PM
#7
Addicted Member
The sndPlaySound function isn't pure VB, it's an API call.
-
Aug 17th, 2002, 07:36 PM
#8
Good Ol' Platypus
Use WaveOutOpen. Here's a C example (easily ported to VB).
http://www.borg.com/~jglatt/tech/lowaud.htm
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Aug 27th, 2002, 05:27 PM
#9
Fanatic Member
Try Windows Media Player
I Found Out The Easiest Way To Play Sound, And Yet, you can do practically anything with it!
Just add the windows media player (msdxm.ocx)
To your components,
if you want to add many songs a once, just load and unload them while checking the duration with a timer.
Why do I use win. player?
Cuz its easy to lower & upper the volume,
Cuz you can ummm, lower & upper the volume,
and umm, I dont remember Why else I used it...
But there must be some reason......
Lol, I'll check that out immidiately... see y@
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
|