need some sound help

Blitz3D Forums/Blitz3D Beginners Area/need some sound help

The code here is untested and I may have forgotten a few parameters, but it's to give the idea how to work this out...
I removed all unnessesary lines like the lines in which you load the sound and such, it's just to solve the problem you have


Global OldTimer = MilliSecs()
Global NewTimer = MilliSecs()

Repeat 
NewTimer = MilliSecs()
If KeyDown(200) And (NewTimer-OldTmer>2000) THen
   PlaySound SoundBufferVar
   OldTImer = NewTimer
   EndIf
Until Keyhit(1)



This silly routine will make the step sound every two seconds, you can make it faster or slower by adepting the 2000 in this code...

The steps are only made as long as the up key is hold down, and will stop as soon as it's released...

As I said this code is untested, it's more to give a general idea on how to solve this...