MaxMod Streaming ChannelPlaying() incorrect...

BlitzMax Forums/BlitzMax Programming/MaxMod Streaming ChannelPlaying() incorrect...

MaxMod Streamed music returns an incorrect value when the ChannelPlaying() method is called e.g.

Import MaxMod.AudioStream
Import MaxMod.OGG

Incbin "Project/media/sfx/tracks/tune1.ogg"
Incbin "Project/media/sfx/tracks/tune2.ogg"

Graphics 100,100

If EnableOpenALAudio()
	If SetAudioDriver("OpenAL Generic Software")
		Local aMusicChannel:TChannel = AllocChannel()
		If ChannelPlaying(aMusicChannel) = False
			aMusicChannel = CreateAudioStream("incbin::Project/media/sfx/tracks/tune1.ogg")
		EndIf
		
		Delay(1000)
		
		If ChannelPlaying(aMusicChannel) Then
			aMusicChannel.Stop()
			
			'Local bMusicChannel:TChannel = AllocChannel()
			If ChannelPlaying(aMusicChannel) = False
				aMusicChannel = CreateAudioStream("incbin::Project/media/sfx/tracks/tune2.ogg")
			EndIf
		Else
			Print "Music not playing - Issue"
		End If
		WaitKey()
		End
	EndIf
EndIf


What should happen here is tune1 should be streamed and play for a second then tune1 should be stopped and tune2 should play.

What happens tune1 playes and the program prints "Music not playing - Issue"

When ChannelPlaying() is called it returns false when the first track can be heard playing?

Played around with the delay on this and it would appear that a delay of over 500ms on my machine sometimes returns a false negative from ChannelPlaying() when streaming in an ogg music track. And always returns a false negative when the delay is over 750 ms!

Has anyone else encountered this problem?

OK simple work around for me I just skip the first updates call to ChannelPlaying and it works???

oh sorry mate, must've missed this one yesterday, I'll have a look at it in a bit, but dont want to spend to much time on the old maxmod.