oh great, now i feel like an idiot!

Blitz3D Forums/Blitz3D Beginners Area/oh great, now i feel like an idiot!

Why not use ChannelPlaying() instead of using a separate var:
mySound=LoadSound("mySample.wav")
LoopSound mySound

While Not KeyHit(1)
	If KeyDown(57); SPACE KEY
		If Not ChannelPlaying(myChannel)
			myChannel=PlaySound(mySound)
		EndIf	
	Else
		If ChannelPlaying(myChannel)
			StopChannel myChannel
		EndIf
	EndIf
Wend

FreeSound mySound