[vorbis] Using vorbisfile with an in-memory file instead of FILE*

Michael Smith msmith at labyrinth.net.au
Thu Dec 28 07:23:21 PST 2000



>> 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 'correct' answer is - it should do whatever stdio does on a real file
if you do the equivalent. The reality is that it won't call close multiple
times, so it doesn't matter. For your case, yes - just returning success is
sufficient, unless you want it to do other cleanup (like freeing the
allocated memory, etc.)

>
>> 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.

The offset is relevent at the ogg layer rather than at the vorbis layer.
ogg is designed for more than just audio - a video codec is a future
project, for instance. In that case, 32 bits certainly isn't enough. As a
result, ogg really needs more than 32 bit offsets, so the external API
exposes this (even though, for vorbis, it's not terribly neccesary). 

If it's a problem, just using 32 bit offsets will work fine (casting them
to 64 bits as appropriate, of course) - that's what the standard stdio
calls do.

>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

Yeah, the docs aren't entirely up to date, but the differences are (I
think) all trivial things like this.

>
>One small question:
>When will the oggenc support mono?

beta2, I think (yes, that was ages ago).

>When will it support 22050 hz?

beta3 (i.e. the current beta)

>If the answer is beta 4, when can beta 4 be expected?

It isn't the answer, but it should be roughly mid-january (hopefully).
Mono works fully (and has for ages). Sample rates other than 44.1kHz work,
but aren't completely optimised (i.e. although everything works, sound
quality will be lower than vorbis is capable of). Try it and see.

Michael

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