Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Looping Sounds
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kingkirb
Squire

United Kingdom
19 Posts

Posted - Jun 21 2006 :  3:09:31 PM  Show Profile  Reply with Quote
Sorry im being a pest with all these topics!
I have started adding some very basic .wav sounds to my game. To do this i am using a module containing

Option Explicit
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Global Const SND_ASYNC = &H1

and then to play the sounds i use the code

rc = sndPlaySound(App.Path & "\Boss Theme.wav", SND_ASYNC)
(boss theme being the name of the sound file)

My problem is that the sound plays fine and i can stop it when i want by playing the victory sound but if the player is still fighting the boss and the sound runs out it stops and i dont know how to loop the sound until the boss dies. Has anyone any ideas???

Thanks J(Kingkirb)

PW7962
Squire

USA
33 Posts

Posted - Jun 21 2006 :  5:06:20 PM  Show Profile  Visit PW7962's Homepage  Send PW7962 an AOL message  Reply with Quote
add this in the declarations:

Public Const SND_LOOP = &H8

Then call sndPlaySound(App.path & "\Boss Theme.wav", SND_ASYNC + SND_LOOP)

I did not test this but I believe that is how you can make it loop.


Star Fantasy Unlimited Programmer

http://starfantasy.forumer.com
Go to Top of Page

kingkirb
Squire

United Kingdom
19 Posts

Posted - Aug 11 2006 :  09:29:04 AM  Show Profile  Reply with Quote
thanks that works perfectly. Sorry my reply is so late i have major ISP problems. J kingkirb
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.08 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.