LoopSound for OpenAL >:D

BlitzMax Forums/BlitzMax Module Tweaks/LoopSound for OpenAL >:D

JoshK(Posted 2007) [#1]
This will allow old-school LoopSound() behavior with OpenAL sound samples. OpenAL sound samples are the same whether they are looped or not, so there's not any reason to use the loop loading flag, unless you are using another audio system.

I don't think the SOUND_HARDWARE flag will have any effect on OpenAL samples, either.
EnableOpenALAudio()
SetAudioDriver "OpenAL"

sound:TSound=LoadSound("Bounce_Metal.wav")
openalsound:TOpenALSound=TOpenALSound(sound)

LoopSound sound
PlaySound sound

Delay 200

LoopSound sound,False
PlaySound sound

Delay 10000
End

Function LoopSound(sound:TSound,loop=True)
	openalsound:TOpenALSound=TOpenALSound(sound)
	If Not openalsound Return
	openalsound._loop=loop
EndFunction