[vorbis] Using vorbisfile with an in-memory file instead of FILE*
Olaf van der Spek
Olaf at XCC.TMFWeb.NL
Thu Dec 28 07:07:39 PST 2000
----- Original Message -----
From: "Michael Smith" <msmith at labyrinth.net.au>
To: <vorbis at xiph.org>
Sent: Monday, December 25, 2000 2:05 PM
Subject: Re: [vorbis] Using vorbisfile with an in-memory file instead of
FILE*
>
> >> Use ov_open_callbacks() and write callbacks which fake reading from a
file
> >> (while actually reading from memory buffers). vorbisfile is designed
for
> >> reading from a file, so the interface is a bit messy when you try to do
> >> this, but it is possible.
> >
> >I thought maybe it was possible with the two parameters that specify
you've
> >already read a bit (in this case the whole file), but that didn't work.
> >Is there some documentation of those callbacks?
> >I didn't find very much docs about it.
>
> Those should work, but aren't a complete solution. You still need to write
> the callbacks (although if you have the ENTIRE file in memory before the
> open call, the callbacks can just return appropriate errors).
>
I assume it should always indicate success for a close, or does it need to
generate an error when close is called multiple times?
> The callbacks follow the prototypes (more or less - the seek function uses
> a 64 bit offset, and they all use void pointers instead of FILE pointers)
> for fread, ftell, fseek, and fclose. They also follow the return
semantics.
Why exactly is a 64 bit offset used?
32 bit (signed) seems enough for more then one year music at 128 kbit/s.
And tell if still 32 bit.
> If you look at the winamp plugin, it provides a pretty complete example of
I'll have a look if it still doesn't work.
> what return values to produce under what circumstances (it actually goes
to
> more effort to produce the exact result than is strictly needed, so as to
> serve as a useful example). Basically, just read manpages/documentation
for
> those functions, and hack something in to do what you want.
> Straightforward. If you want to feed everything through the initial
buffer,
> just have them return the standard error return for that function (0 for
> fread(), etc.)
It seems the docs aren't up to date.
At http://www.xiph.org/ogg/vorbis/doc/vorbisfile/ov_callbacks.html it talkes
about int64_t , while that should be ogg_int64_t
One small question:
When will the oggenc support mono?
When will it support 22050 hz?
If the answer is beta 4, when can beta 4 be expected?
--- >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