[sdlsound] need help putting it all together (sdl_sound,sdl_m ixer,physfs)

Eric Wing ewing2121 at yahoo.com
Wed Dec 4 20:06:56 EST 2002


I figured out my playback speed problem. I was
incorrectly assuming that the number of bytes decoded
was the same as the sample->buffer_size for
Sound_Decode(sample) (except for EOF).

However finding this made me discover another problem
I'm hoping somebody can help me with. I noticed that
when running Sound_Decode() on .OGG files, the bytes
returned never matches my requested buffer size. This
occurs in both my own programs and Ryan's "playsound"
demo.

Using "playsound", for the default 16384 decodebuf
size, I seem to get one of three fixed sizes per
decode: 4096, 512, 2304. (I'm not sure what the
significance of these values are, especially the last
one.)

Furthermore, I noticed that in all cases, the
SOUND_SAMPLEFLAG_EAGAIN flag gets set on every decode
(and I am nowhere near EOF). Is this a bad thing, or
is it normal? Can somebody explain what this flag
means. SOUND_SAMPLEFLAG_ERROR ever gets set.

I've run these experiments using playsound in both
Linux (Debian,Redhat) and OSX, and this behavior is
consistent among machines.

I believe this small buffer size is making continuous
sounding streaming very difficult. Playsound can get
away with this in Linux, but my faster Mac cannot
stream my OGGs without bad breakup. 

Also, I have an additional problem because I'm trying
write my own applications to run SDL_Sound through
SDL_mixer. Because of the unfortunately long latencies
in SDL_mixer, the small buffersize is killing my
streaming ability, even in Linux.

So is there a way I can get Sound_Decode to actually
decode to my requested buffer size. Or is there a
workaround I can try?

Thanks,
Eric





__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the sdlsound mailing list