vorbisfile - datatype - OggVorbis_File

vorbisfile documentation | vorbisfile version 1.25 - 20000615

# OggVorbis_File

declared in "vorbis/vorbisfile.h"

The OggVorbis_File structure defines an Ogg Vorbis file.

This structure is used in all vorbisfile routines. Before it can be used, it must be initialized by ov_open or ov_open_callbacks.

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

Once a file or data source is passed to libvorbisfile, it is owned by vorbisfile. The file should not be used by any other applications or functions outside the Vorbisfile API.

    typedef struct {
      void             *datasource; /* Pointer to a FILE *, etc. */
      int              seekable;
      int64_t          offset;
      int64_t          end;
      ogg_sync_state   oy;

      /* If the FILE handle isn't seekable (eg, a pipe), only the current
         stream appears */
      int              links;
      int64_t          *offsets;
      int64_t          *dataoffsets;
      long             *serialnos;
      int64_t          *pcmlengths;
      vorbis_info      *vi;
      vorbis_comment   *vc;

      /* Decoding working state local storage */
      int64_t          pcm_offset;
      int              decode_ready;
      long             current_serialno;
      int              current_link;

      double           bittrack;
      double           samptrack;

      ogg_stream_state os; /* take physical pages, weld into a logical
                              stream of packets */
      vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
      vorbis_block     vb; /* local working space for packet->PCM decode */

      ov_callbacks callbacks;

    } OggVorbis_File;

### Relevant Struct Members

datasource
  Pointer to file or other ogg source.
seekable
  Read-only int indicating whether file is seekable, i.e., physical file is seekable, a pipe isn't.
links
  Read-only int indicating the number of logical bitstreams within the physical bitstream.
ov_callbacks
  Collection of file manipulation routines to be used on this data source.

### Notes

If your system's `<sys/types.h>` does not define `int64_t,` you will need to define this as a 64-bit type inside your system's project file/Makefile, etc. On win32, for example, this should be defined as `__int64`. On the Unix platform, these are usually defined properly in the system header files.

copyright © 2000 vorbis team | Ogg Vorbis team@vorbis.org
vorbisfile documentation | vorbisfile version 1.25 - 20000615