Click to See Complete Forum and Search --> : how can i stop a looping sound?
Doomstar
Jan 22nd, 2000, 02:52 AM
I've recently programmed a small game which is part of a program, nothing fancy (no DirectX and stuff), in which I use an API call to play sounds. I have this background loop (a wave file) which doesn't stop playing after I close the window, while I've let the program play (both loop AND normal) an empty wave file (about 2 secs of silence) on the unload event of the form.
------------------
Doomstar
http://come.to/Doomstar
MartinLiss
Jan 22nd, 2000, 06:07 AM
Try putting a DoEvents statement inside the sound loop.
------------------
Marty
Can you buy an entire chess set in a pawn shop?
Aaron Young
Jan 22nd, 2000, 06:56 AM
The Sound should be stopped as soon as your App is unloaded, perhaps you have another form, or some other Routine running which is keeping the App in Memory and not Unloading properly?
To Force a WAV to Stop, use the SND_PURGE Constant with the sndPlaySound API, ie.
Private Sub Form_Unload()
Call sndPlaySound("", SND_PURGE)
End Sub
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
ajyoung@pressenter.com
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.