[vorbis-dev] Reading OGG embedded in a pack file - small patch to sdl_mixer and example file
post at andre-krause.net
Tue May 4 10:41:04 PDT 2004
Hello, i had the same problem , streaming oggs from an archive. I found a
very simple solution, just changing a little in sdl_mixer.
The zip contains an example file using the great lib PHYSfs (
http://icculus.org/physfs/ ) for archive support. No need to bother with
seek - callbacks if you first extract the complete ogg into memory (ok, not
optimal, but who cares today about 2-5 megs less working mem) and then using
SDL_RWFromMem to create an rwops. The ogg then is streamed from mem using
<p><p><p> SDL_RWops * rw=NULL;
//First thing you need to do is initialize the filesystem. reason:
linux needs this whyever..
// add the contents of myzip to the end of the "searchpath" (0 to
cerr << "\nfilelength:" << PHYSFS_fileLength(filehande);
myBuf = new char[PHYSFS_fileLength(filehande)];
int bytesread=PHYSFS_read (filehande, myBuf, sizeof(char),
cerr << "\nbytes read into mem:" << bytesread;
rw = SDL_RWFromConstMem(myBuf,bytesread*sizeof(char));
Mix_Music *music = Mix_LoadMUS_RW(rw);
<p>> -----Original Message-----
> From: owner-vorbis-dev at xiph.org
> [mailto:owner-vorbis-dev at xiph.org] On Behalf Of Ken Rogoway
> Sent: Dienstag, 4. Mai 2004 18:53
> To: vorbis-dev at xiph.org
> Subject: Re: [vorbis-dev] Reading OGG embedded in a pack file
> > I'm the guy who did the fishmixer thing. It's a patch to SDL_mixer
> > that replaces the ogg/vorbis loader with fishsound, letting
> > load vorbis and speex. Since libfishsound doesn't provide a
> > and since I hate having to know pcm-total in advance anyway, the
> > fishmixer patch grows the sound buffer as more samples come in.
> > So I make a buffer that's big enough without having to
> allocate that
> > buffer at the start. You might give it a look - since you're having
> > trouble with pcm-total, just don't use it at all.
> Thanks Daniel. I will take a look at libfishsound.
> - Ken
> --- >8 ----
> List archives: http://www.xiph.org/archives/ Ogg project
> homepage: http://www.xiph.org/ogg/ To unsubscribe from this
> list, send a message to 'vorbis-dev-request at xiph.org'
> containing only the word 'unsubscribe' in the body. No
> subject is needed.
> Unsubscribe messages sent to the list will be ignored/filtered.
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis-dev