Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / sound loop problem

Author
Message
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 8th Jun 2003 06:00 Edited at: 8th Jun 2003 06:03
i have a problem with looping my sounds.
i'm using a code like:



but the problem is that if i hold down my mousebutton it plays the sound a trillion times at the same time like a machinegun but what i want is that their is a little time between them.
and if i use the fallowing code:



when i use this code their is to much time between each loop and if i hold the mousebutton down i get a weird noise.

can somebody help me.

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 10GB HD, Riva TNT2 Ultra 32mb
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 8th Jun 2003 07:15 Edited at: 8th Jun 2003 07:15
figure out how long your sound is, then do somethin' like this:



hope this works!

---Mattman
"Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done." Andy Rooney
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 8th Jun 2003 13:03
here this will stop the machine gun effect as you have to release the mouse button and press it again before it plays the sound


or this one will allow you to hold the mouse button down but waits for 2 seconds before playing the sound


hope it helps

ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL mynameisnoneofyourbuisness@hotmail.com to work on the new Star Strike project!!!
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 8th Jun 2003 14:03
i want to use it my first person shooter so i need the machine gun effect but not so fast, this means i can't use the wait command.

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 10GB HD, Riva TNT2 Ultra 32mb
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 8th Jun 2003 19:50
ok this will only play the sound if the sound isn't already playing


try that

ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL mynameisnoneofyourbuisness@hotmail.com to work on the new Star Strike project!!!
xmen
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location:
Posted: 9th Jun 2003 02:11
`try this



load sound "sound.wav",1
sync on
do

if mouseclick()=1 and sound playing(1)=0
play sound 1
endif

sync
loop
`.......xmen........

Login to post a reply

Server time is: 2024-11-24 16:31:59
Your offset time is: 2024-11-24 16:31:59