yes for your latest code. BUT how come if you FREE those unused channels you still hit the 256 limit. If you play a sound on the channel BEFORE freeing it then the channel is properly freed thus it seems as though there is no limit. That's the bug, I'm 99% sure.
Regarding freeing a channel, I just recalled that nulling the pointer isn't good enough, you ARE supposed to use StopChannel first. However, as per my very first example, this doesn't work either. Good job you got me reminded of this as I've updated the code in the bug forum to use stopchannel properly like so:
Regarding freeing a channel, I just recalled that nulling the pointer isn't good enough, you ARE supposed to use StopChannel first. However, as per my very first example, this doesn't work either. Good job you got me reminded of this as I've updated the code in the bug forum to use stopchannel properly like so:
Strict EnableOpenALAudio() SetAudioDriver("OpenAL Generic Software") 'change to FreeAudio or DirectSound for no crash Local sound:TSound = LoadSound("test.wav") Graphics 400,300,0 Local counter:Int = 0 Local mychannel:TChannel While Not KeyHit(KEY_ESCAPE) Cls mychannel=AllocChannel() If counter>250 Then PlaySound sound , mychannel Else StopChannel(mychannel) mychannel = Null 'this line is not required EndIf DrawText counter , 0 , 0 DrawText GCMemAlloced(),0,100 counter:+ 1 Flip If counter > 500 End Wend