Oliver
2003-Dec-03 12:01 UTC
[vorbis] play a ogg file from a given buffer instead of a file
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? Thanks. --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Michael Smith
2003-Dec-03 17:35 UTC
[vorbis] play a ogg file from a given buffer instead of a file
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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.