[vorbis-dev] Reading OGG embedded in a pack file
Ken Rogoway
Ken at Rogoway.com
Mon May 3 23:41:53 PDT 2004
>There is a separate set of API calls for playing a background music track
that
>may use streaming techniques when possible.
>It should be noted that SDL_Mixer has native support for loading Ogg Vorbis
samples.
>The documentation says you can pass an Ogg Vorbis filename to a number of
the
>LoadWAV calls and it will handle them transparently. This doesn't help
directly
>with your packed data format, but another possible approach is to the
>Mix_LoadWAV_RW with an SDL_RWops callback set to feed it the data similar
to
>what you're already doing with libvorbisfile.
Actually, this is exactly what I am doing. I have modified the code in
load_ogg.c (a part of the SDL_mixer to handle the case when the stream is
starting at a seek position that is not 0. If this is true then I use
different seek and tell callbacks to tell libvorbisfile that the stream is
not seekable. However, since the mixer calls the ov_pcm_total() function
which does not know anything about the fact that I am a small file inside a
larger stream, it fails. I think if I am going to try and "hack" it in this
way I need to do as suggested and modify all of the callback functions to
work relative to the beginning of the sub-file I am currently positioned at
and also deal with reading past the end of the sub-file.
>Or, you can give up an write your own mixer on top of basic SDL_Audio,
which of
>course gives you much more control of how the data is handled. I suspect
this is
>more the situation Mike was assuming you where in in the first place.
The simple solution is to leave the OGG files as individual files and
everything works fine. I just felt it was more professional to package up
all of my assets into a pack file rather than have a couple hundred assets
installed on the end users hard drive.
Thanks for everyones suggestions and feedback. I appreciate the time you
have taken and think I will go with handling the seek, tell, etc,
appropriately for my sub-file. If that doesn't work then I will just leave
the files as individual OGG files in the distribution.
FWIW,
-r
--- >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.
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.672 / Virus Database: 434 - Release Date: 4/28/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.672 / Virus Database: 434 - Release Date: 4/28/2004
--- >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
mailing list