Chris@1: Chris@1: Chris@1: Chris@1: Vorbisfile - Setup/Teardown Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:

Vorbisfile documentation

vorbisfile version 1.3.2 - 20101101

Chris@1: Chris@1:

Setup/Teardown

In order to decode audio using Chris@1: libvorbisfile, a bitstream containing Vorbis audio must be properly Chris@1: initialized before decoding and cleared when decoding is finished. Chris@1: The simplest possible case is to use ov_fopen() to open the file for access, check Chris@1: it for Vorbis content, and prepare it for playback. A successful return code from ov_fopen() indicates the file is ready for use. Chris@1: Once the file is no longer needed, ov_clear() is used to close the file and Chris@1: deallocate decoding resources.

Chris@1: Chris@1: On systems other than Windows[a], an Chris@1: application may also open a file itself using fopen(), then pass the Chris@1: FILE * to libvorbisfile using ov_open(). Do not call Chris@1: fclose() on a file handle successfully submitted to ov_open(); libvorbisfile does this in the ov_clear() call.

Chris@1: Chris@1: An application that requires more setup flexibility may open a data Chris@1: stream using ov_open_callbacks() Chris@1: to change default libvorbis behavior or specify non-stdio data access Chris@1: mechanisms.

Chris@1: Chris@1:

Chris@1: All libvorbisfile initialization and deallocation routines are declared in "vorbis/vorbisfile.h". Chris@1:

Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:
functionpurpose
ov_fopenOpens a file and initializes the Ogg Vorbis bitstream with default values. This must be called before other functions in the library may be Chris@1: used.
ov_openInitializes the Ogg Vorbis bitstream with default values from a passed in file handle. This must be called before other functions in the library may be Chris@1: used. Do not use this call under Windows [a]; Use ov_fopen() or ov_open_callbacks() instead.
ov_open_callbacksInitializes the Ogg Vorbis bitstream from a file handle and custom file/bitstream manipulation routines. Used instead of ov_open() or ov_fopen() when altering or replacing libvorbis's default stdio I/O behavior, or when a bitstream must be initialized from a FILE * under Windows.
ov_testPartially opens a file just far enough to determine if the file Chris@1: is an Ogg Vorbis file or not. A successful return indicates that the Chris@1: file appears to be an Ogg Vorbis file, but the OggVorbis_File struct is not yet fully Chris@1: initialized for actual decoding. After a successful return, the file Chris@1: may be closed using ov_clear() or fully Chris@1: opened for decoding using ov_test_open().

This call is intended to Chris@1: be used as a less expensive file open test than a full ov_open().

Chris@1: Note that libvorbisfile owns the passed in file resource is it returns success; do not fclose() files owned by libvorbisfile.

ov_test_callbacksAs above but allowing application-define I/O callbacks.

Chris@1: Note that libvorbisfile owns the passed in file resource is it returns success; do not fclose() files owned by libvorbisfile.

ov_test_open Chris@1: Finish opening a file after a successful call to ov_test() or ov_test_callbacks().
ov_clear Closes the Chris@1: bitstream and cleans up loose ends. Must be called when Chris@1: finished with the bitstream. After return, the OggVorbis_File struct is Chris@1: invalid and may not be used before being initialized again Chris@1: before begin reinitialized. Chris@1: Chris@1:
Chris@1: Chris@1:

Chris@1:


Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1: Chris@1:

copyright © 2000-2010 Xiph.Org

Ogg Vorbis

Vorbisfile documentation

vorbisfile version 1.3.2 - 20101101

Chris@1: Chris@1: Chris@1: Chris@1: