engine: github.com/g3n/engine/audio/ov Index | Files

package ov

import "github.com/g3n/engine/audio/ov"

Package ov implements the Go bindings of a subset of the functions of the Ogg Vorbis File C library. The libvorbisfile C API reference is at: https://xiph.org/vorbis/doc/vorbisfile/reference.html

Index

Package Files

vorbisfile.go

Constants

const (
    Eread      = C.OV_EREAD
    Efault     = C.OV_EFAULT
    Eimpl      = C.OV_EIMPL
    Einval     = C.OV_EINVAL
    EnotVorbis = C.OV_ENOTVORBIS
    EbadHeader = C.OV_EBADHEADER
    Eversion   = C.OV_EVERSION
    EnotAudio  = C.OV_ENOTAUDIO
    EbadPacket = C.OV_EBADPACKET
    EbadLink   = C.OV_EBADLINK
    EnoSeek    = C.OV_ENOSEEK
)

func Clear Uses

func Clear(f *File) error

Clear clears the decoded buffers and closes the file

func Info Uses

func Info(f *File, link int, info *VorbisInfo) error

Info updates the specified VorbisInfo structure with contains basic information about the audio in a vorbis stream

func PcmSeek Uses

func PcmSeek(f *File, pos int64) error

Seek seeks to the offset specified (in number pcm samples) within the physical bitstream. This function only works for seekable streams. Updates everything needed within the decoder, so you can immediately call Read() and get data from the newly seeked to position.

func PcmTotal Uses

func PcmTotal(f *File, i int) (int64, error)

PcmTotal returns the total number of pcm samples of the physical bitstream or a specified logical bit stream. To retrieve the total pcm samples for the entire physical bitstream, the 'link' parameter should be set to -1

func Read Uses

func Read(f *File, buffer unsafe.Pointer, length int, bigendianp bool, word int, sgned bool) (int, int, error)

Read decodes next data from the file updating the specified buffer contents and returns the number of bytes read, the number of current logical bitstream and an error

func Seekable Uses

func Seekable(f *File) bool

Seekable returns indication whether or not the bitstream is seekable

func TimeTell Uses

func TimeTell(f *File) (float64, error)

TimeTell returns the current decoding offset in seconds.

func TimeTotal Uses

func TimeTotal(f *File, i int) (float64, error)

TimeTotal returns the total time in seconds of the physical bitstream or a specified logical bitstream To retrieve the time total for the entire physical bitstream, 'i' should be set to -1.

type File Uses

type File struct {
    // contains filtered or unexported fields
}

File type encapsulates a pointer to C allocated OggVorbis_File structure

func Fopen Uses

func Fopen(path string) (*File, error)

Fopen opens an ogg vorbis file for decoding Returns an opaque pointer to the internal decode structure and an error

type VorbisInfo Uses

type VorbisInfo struct {
    Version        int
    Channels       int
    Rate           int
    BitrateUpper   int
    BitrateNominal int
    BitrateLower   int
    BitrateWindow  int
}

Package ov imports 3 packages (graph) and is imported by 3 packages. Updated 2018-08-25. Refresh now. Tools for package owners.