cannam@86: cannam@86: cannam@86: cannam@86: Vorbisfile - datatype - OggVorbis_File cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86:

Vorbisfile documentation

vorbisfile version 1.3.2 - 20101101

cannam@86: cannam@86:

OggVorbis_File

cannam@86: cannam@86:

declared in "vorbis/vorbisfile.h"

cannam@86: cannam@86:

cannam@86: The OggVorbis_File structure defines an Ogg Vorbis file. cannam@86:

cannam@86: cannam@86: This structure is used in all libvorbisfile routines. Before it can cannam@86: be used, it must be initialized by ov_open(), ov_fopen(), or ov_open_callbacks(). Important cannam@86: Note: The use of ov_open() is cannam@86: discouraged under Windows due to a peculiarity of Windows linking cannam@86: convention; use ov_fopen() or ov_open_callbacks() instead. This cannam@86: caution only applies to Windows; use of ov_open() is appropriate for all other cannam@86: platforms. See the ov_open() page for more cannam@86: information. cannam@86: cannam@86:

cannam@86: After use, the OggVorbis_File structure must be deallocated with a cannam@86: call to ov_clear(). cannam@86: cannam@86:

cannam@86: Note that once a file handle is passed to a successful ov_open() call, the handle is owned by cannam@86: libvorbisfile and will be closed by libvorbisfile later during the cannam@86: call to ov_clear(). The handle should not cannam@86: be used or closed outside of the libvorbisfile API. Similarly, files cannam@86: opened by ov_fopen() will also be closed cannam@86: internally by vorbisfile in ov_clear().

cannam@86: cannam@86: ov_open_callbacks() allows the cannam@86: application to choose whether libvorbisfile will or will not close the cannam@86: handle in ov_clear(); see the ov_open_callbacks() page for more information.

cannam@86: cannam@86: If a call to ov_open() or ov_open_callbacks() fails, cannam@86: libvorbisfile does not assume ownership of the handle and the cannam@86: application is expected to close it if necessary. A failed ov_fopen() call will internally close the cannam@86: file handle if the open process fails.

cannam@86: cannam@86:

cannam@86: cannam@86: cannam@86: cannam@86: cannam@86:
cannam@86:
typedef struct {
cannam@86:   void             *datasource; /* Pointer to a FILE *, etc. */
cannam@86:   int              seekable;
cannam@86:   ogg_int64_t      offset;
cannam@86:   ogg_int64_t      end;
cannam@86:   ogg_sync_state   oy; 
cannam@86: 
cannam@86:   /* If the FILE handle isn't seekable (eg, a pipe), only the current
cannam@86:      stream appears */
cannam@86:   int              links;
cannam@86:   ogg_int64_t      *offsets;
cannam@86:   ogg_int64_t      *dataoffsets;
cannam@86:   long             *serialnos;
cannam@86:   ogg_int64_t      *pcmlengths;
cannam@86:   vorbis_info      *vi;
cannam@86:   vorbis_comment   *vc;
cannam@86: 
cannam@86:   /* Decoding working state local storage */
cannam@86:   ogg_int64_t      pcm_offset;
cannam@86:   int              ready_state;
cannam@86:   long             current_serialno;
cannam@86:   int              current_link;
cannam@86: 
cannam@86:   ogg_int64_t      bittrack;
cannam@86:   ogg_int64_t      samptrack;
cannam@86: 
cannam@86:   ogg_stream_state os; /* take physical pages, weld into a logical
cannam@86:                           stream of packets */
cannam@86:   vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
cannam@86:   vorbis_block     vb; /* local working space for packet->PCM decode */
cannam@86: 
cannam@86:   ov_callbacks callbacks;
cannam@86: 
cannam@86: } OggVorbis_File;
cannam@86:
cannam@86: cannam@86:

Relevant Struct Members

cannam@86:
cannam@86:
datasource
cannam@86: cannam@86:
Pointer to file or other ogg source. When using stdio based cannam@86: file/stream access, this field contains a FILE pointer. When using cannam@86: custom IO via callbacks, libvorbisfile treats this void pointer as a cannam@86: black box only to be passed to the callback routines provided by the cannam@86: application.
cannam@86: cannam@86:
seekable
cannam@86:
Read-only int indicating whether file is seekable. E.g., a physical file is seekable, a pipe isn't.
cannam@86:
links
cannam@86:
Read-only int indicating the number of logical bitstreams within the physical bitstream.
cannam@86:
ov_callbacks
cannam@86:
Collection of file manipulation routines to be used on this data source. When using stdio/FILE access via ov_open(), the callbacks will be filled in with stdio calls or wrappers to stdio calls.
cannam@86:
cannam@86: cannam@86:

cannam@86:
cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86:

copyright © 2000-2010 Xiph.Org

Ogg Vorbis

Vorbisfile documentation

vorbisfile version 1.3.2 - 20101101

cannam@86: cannam@86: cannam@86: cannam@86: