AudioBuffers=4SoundID_Engine=GENSOUND()LOADSOUND "./Media/Engine.wav" , SoundID_Engine , AudioBuffersIn order to loop your sound perfectly, you must know how long it is, and standardize all sound loop sizes!

So with windows, sndrec32.exe in the entertainment menu or from run box, open your engine sound. If the sound is 1.25 seconds long....move the selector to 1.0 seconds and then choose delete after current position. Because we will be looping all looped sounds every one second.

The rule of thumb here is consistancy, so make a standard size of loop, this way you can loop multiple types of sounds with one sound timer routine, in your main loop.This routine below will only attempt to play a sound every one second, put in main loop:

EngineTimer=EngineTimer+GETTIMER()IF EngineTimer >= 999.0; EngineTimer = EngineTimer - 999.0; PlayAudioLoops1=TRUE;ENDIFNow the timer is running, every one second it is going to tell your next function to play all your loops.

IF PlayAudioLoops1=TRUE; PlayAudioLoops1=FALSE; PLAYSOUND( SoundID_Engine , 0 , 1.0 )ENDIFThe sound is being played every second, and your sound is exactly one second long.Now you dont need SOUNDPLAYING(), which will cause a delay in the audio loop, if you do.Dont use SOUNDPLAYING() with this loop timer...youll get mixed results.

You can set all your sound buffers up to 4 now.

If your audio loops are smaller than 1 second, like a bullet for instance...Set the sound to some hundreds of millseconds....for instance, 40% of a second...400ms in sndrec32.exe.

EngineTimer=EngineTimer+FrameTimeMsIF EngineTimer >= 399.0; EngineTimer = EngineTimer - 399.0; PlayAudio2=TRUE;ENDIFSo, this is why you need to standardize all your sounds....make some loops that are one second long, and a few 400ms long.....and you the above timers to trigger all of them, perfectly timed.