[Done] OGG stream, sound library (IMA's and fails)

Post bugreports for the Windows version here
benubi
Enthusiast
Enthusiast
Posts: 112
Joined: Tue Mar 29, 2005 4:01 pm

[Done] OGG stream, sound library (IMA's and fails)

Post by benubi »

Same behavior on Windows with the 32bit and 64bit version (on a W10 machine). The Problem also exists on Linux 64bit (32 not tested but probable). I noticed in since PB6 beta when the streaming would fail. Before that I had random IMA's sometimes when using the sound lib "extensively" but it seemed relatively stable until PB6.

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
Swap both lines in the example code and test.


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)
Fred
Administrator
Administrator
Posts: 16581
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Done] OGG stream, sound library (IMA's and fails)

Post by Fred »

Fixed.
Post Reply