[Scummvm-devel] Streaming sounds in Scumm games

Max Horn max at quendi.de
Wed Aug 5 21:25:53 CEST 2009

Am 05.08.2009 um 20:55 schrieb Johannes Schickel:

> Hi again,
> I did take a short look into the VOC code. It seams the transition
> should be pretty straight forwarded. One could adapt the  
> "makeVOCStream"
> factory to match the ones for MP3, OGG/Vorbis and FLAC along with it
> too. (That's an old TODO from our TODO page), this would then ease to
> make it clear, that the code will take over the "stream" object.

Yup, something like that was always the long-term plan for the various  
sound decoder "streams": Provide a factory which takes a  
(Seekable)ReadStream (whether it's a file or a memory stream would be  
irrelevant), and turn it into an AudioStream. :)

Just never got around to implement this everywhere properly :/.

> However there seems to be some little problem, which might require  
> some
> more tinkering. The SAGA engine does use the "loadVOCFromStream"  
> method,
> which does load the whole VOC file into memory and just returns a
> pointer to the sample data. I'm not familiar with the SAGA code, so  
> one
> of its developers might want to comment on why it does that and  
> whether
> it could be easily changed. After all it supports MP3 etc. compression
> of the audio files too, so I would guess it shouldn't be too hard to
> adapt the VOC playback to allow proper streaming of VOC files too.

Well, in the meantime, we could live with some code duplication, and  
keep loadVOCFromStream(), while rewriting makeVOCStream() to work  
without it.

BTW, all of the above also applies to the WAVE code and  
loadWAVFromStream(). Unfortunately, it is used in far more engines:
   agos, gob, saga, scumm, sword1, sword2, tucker
But I'd consider it a worthwhile quest to convert as many of these as  
possible to use makeWAVStream


More information about the Scummvm-devel mailing list