This code fails loading the ogg stream and playing it:
Code: Select all
InitSound() ; Initialize Sound system
UseFLACSoundDecoder() ; This Causes a bug when called before UseOGGSoundDecoder()
UseOGGSoundDecoder() ; Use ogg files
fname$ = "battlesound.ogg"
fname$ = OpenFileRequester("Open sound file",fname$,"Sound files|*.ogg;*.flac;*.mp3;*.wav;*.pcm;*.iff;*.raw|All|*.*",0)
; Loads a sound from a file
LoadSound(0, fname$, #PB_Sound_Streaming)
; The sound is playing
PlaySound(0, #PB_Sound_Loop)
MessageRequester("PureBasic "+StrD(#PB_Compiler_Version/100,2), "Ok to stop.")
FreeSound(0) ; The sound is freed
End
Now I found a "work around". It has to do with the decoders.
The OGG will play when the decoders are used in that sequence:
Code: Select all
UseOGGSoundDecoder() ; Use ogg files
UseFLACSoundDecoder() ; This Causes a bug when called before OGG
At first I thought this problem only happens since PB6, but it can also happen on PB5,73 (I wonder how I managed to play the files in between, this is a magic bug now). To me it seemed that there would be a file size limitation, or a buffer overflow causing those IMA's at first. But since I changed the order in which the decoders are used the big ogg files get streamed again. (I have no flac files to test how they react, tho, I use exclusively ogg for the moment)