[vorbis] play a ogg file from a given buffer instead of a file

Michael Smith msmith at xiph.org
Wed Dec 3 17:35:43 PST 2003



On Thursday 04 December 2003 07:01, Oliver wrote:
> Hello.
>
> I haven't found any function to pass a pre-allocated buffer pointer
> containing a encoded OGG data and get the decoded data back. All I've
> found it's from a given filename.
>
> Has anyone needed this before?
> Any idea?
>

I assume you're using libvorbisfile.
Instead of calling ov_open() (which takes a FILE *, to read from a file), use 
ov_open_callbacks, providing a set of callbacks which read data from your 
pre-allocated buffer. These callbacks are fairly trivial to write (and even 
simpler if you don't want to support seeking).

Mike

--- >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-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 mailing list