OK, apart from the fact that if you used the code below to play many sounds at once, or shortly after one an other, it would get very noisy, is there a good reason not to "waste" sound channels like this?
What I mean is, each time Playsound is called, it's returning a new Channel, so what happens to the old one? When does it get freed up as an object. Also leaving so many channels without ever stopping them or freeing them, does this have an adverse affect on the soundcard or CPU. Does anyone know because I certainly don't?
Thanks in advance for any input:
Graphics 800,600,0
'test variables
Global Bang:TSound = LoadSound("data/explosion.wav",False)
Global ChannelBang:TChannel
Repeat
Cls
If KeyHit(KEY_SPACE) Then
ChannelBang = PlaySound(Bang)
EndIf
Flip
Until KeyHit(KEY_ESCAPE)
|