Loop a sound nicely

BlitzMax Forums/BlitzMax Beginners Area/Loop a sound nicely

Will(Posted 2005) [#1]
How do I loop a sound, in this case a siren sound, so that there are no gaps. I tried just checking if the sound was still playing, and if not playing it again, but that leaves a gap sometimes.


Perturbatio(Posted 2005) [#2]
LoadSound with the loop flag set? (I haven't tried it but I'd assume it works ok).


Booticus(Posted 2005) [#3]
Ive found when using an OGG formatted sound, and loading it with the loop flag set to TRUE it works fine. You need an example?


Incbin "Media\Audio\mysound.ogg"
Global filmloop =LoadSound(incbin::Media\Audio\filmloop.ogg",True)
Global channel=PlaySound(filmloop)
SetChannelRate channel,.85 ' For speed



Hotcakes(Posted 2005) [#4]
Side note : if you have a wav or ogg file with silence at the beginning or end (ie you tryed to convert an mp3), there isn't much you can do about that ;]

Except of course to load it up into a sound editor and remove the silence.


Will(Posted 2005) [#5]
thanks guys
all set