Playing a lwav file as background music

Blitz3D Forums/Blitz3D Beginners Area/Playing a lwav file as background music

I was just writing this when Soja replied, I'll post it anyway if it helps....

cut and paste and put your sound file in....

Graphics 800,600
Global MySoundStarted = False
Global MyMusicLoop=LoadSound("YOUR SOUND HERE") 
LoopSound MyMusicLoop
MyChannelSound=PlaySound(MyMusicLoop,2);flag set to pause

SetBuffer BackBuffer() 

While Not KeyHit(1)
	
	If KeyHit(31) Then
		If 	MySoundStarted = False Then
			ResumeChannel MyChannelSound
			MySoundStarted = True		
		Else
			PauseChannel MyChannelSound
			MySoundStarted = False
		EndIf
	EndIf
			 
	Text 30,280,"hit  ESC to quit"
	Text 30,300,"hit  the S key  to turn the sound on and off"
	Flip

Wend

StopChannel MyChannelSound
FreeSound MyMusicLoop

End