Version: v0.0.0-...-9b974ee Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2020 License: GPL-3.0 Imports: 3 Imported by: 0



libvorbis is a libvorbis Go wrapper.



View Source
const (
	CommentArtist      = "ARTIST"
	CommentAlbum       = "ALBUM"
	CommentTitle       = "TITLE"
	CommentTrackNumber = "TRACKNUMBER"

Popular user comment names.

View Source
const (
	LittleEndian = 0
	BigEndian    = 1


This section is empty.


This section is empty.


type Comment

type Comment struct {
	UserComments []string
	Vendor       string

The Comment structure defines an Ogg Vorbis comment.

type File

type File struct {

	// Specifies big or little endian byte packing.
	Endianness int
	// Specifies word size. Possible arguments are 1 for 8-bit samples,
	// or 2 or 16-bit samples. Typical value is 2.
	WordSize int
	// Signed or unsigned data. 0 for unsigned, 1 for signed. Typically 1.
	Signed bool
	// contains filtered or unexported fields

The File structure defines an Ogg Vorbis file.

func New

func New(filename string) (file *File, err error)

New is the simplest function used to open and initialize an File structure. It sets up all the related decoding structure.

func (*File) Close

func (file *File) Close()

Close release file related resources.

func (*File) Comment

func (file *File) Comment() *Comment

Comment returns Comment structure for the file.

func (*File) Info

func (file *File) Info() *Info

Info returns Info structure for the file.

func (*File) Read

func (file *File) Read(buf []byte) int

Read returns up to the specified number of bytes of decoded PCM audio. Return number of read 16-bit words.

TODO: "Return number of read 16-bit words." must be in bytes and the

same for all decoders.

func (*File) TimeTell

func (file *File) TimeTell() float64

TimeTell returns the current decoding offset in seconds.

func (*File) TimeTotal

func (file *File) TimeTotal() float64

TimeTotal returns the total time in seconds of the physical bitstream.

type Info

type Info struct {
	Version        int
	Channels       int
	Rate           int32
	BitrateUpper   int32
	BitrateNominal int32
	BitrateLower   int32
	BitrateWindow  int32

The Info structure contains basic information about the audio in a vorbis bitstream.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL