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:



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


    This section is empty.


    func Clear

    func Clear(f *File) error

      Clear clears the decoded buffers and closes the file

      func Info

      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

        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

          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

            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

              func Seekable(f *File) bool

                Seekable returns indication whether or not the bitstream is seekable

                func TimeTell

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

                  TimeTell returns the current decoding offset in seconds.

                  func TimeTotal

                  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

                    type File struct {
                    	// contains filtered or unexported fields

                      File type encapsulates a pointer to C allocated OggVorbis_File structure

                      func Fopen

                      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

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

                        Source Files