vorbis

package
v0.0.0-...-b05aa3b Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2019 License: MIT Imports: 12 Imported by: 0

README

Package vorbis

Package vorbis is a vorbis decoder implementation in pure golang. it was wrote from scratch follow the Vorbis I specification.

Documentation

Overview

Package vorbis is a vorbis decoder implementation in pure golang. it was wrote from scratch follow the [Vorbis I specification](https://xiph.org/vorbis/doc/Vorbis_I_spec.html).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MDCT

type MDCT struct {
	N   int // 1/1
	N2  int // 1/2
	N4  int // 1/4
	N8  int // 1/8
	N43 int // 3/4
	LDN int // ld(n)
	A   []float32
	B   []float32
	C   []float32
	// contains filtered or unexported fields
}

MDCT calculator

type PacketReader

type PacketReader interface {
	NextPacket() (err error)
	ReadBits(bits uint32) uint32
	ReadBytes(p []byte)
	ReadString() string
}

type Vorbis

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

Vorbis decoder

func New

func New(r io.Reader, t wav.Type) (vb *Vorbis, err error)

New vorbis decoder

func Open

func Open(filename string) (*Vorbis, error)

Open vorbis file

func (*Vorbis) BitsPerSample

func (vb *Vorbis) BitsPerSample() int

BitsPerSample reports bits per sample (single track)

func (*Vorbis) Close

func (vb *Vorbis) Close() error

func (*Vorbis) Comment

func (vb *Vorbis) Comment(name string) string

Comment reports of the name, i.e. vb.Comment("TITLE")

func (*Vorbis) Comments

func (vb *Vorbis) Comments() map[string]string

Comments reports the NAME=value comment pairs

func (*Vorbis) Duration

func (vb *Vorbis) Duration() time.Duration

Duration of the audio

func (*Vorbis) Frequency

func (vb *Vorbis) Frequency() int

Frequency reports the sample frequency. i.e. 441000

func (*Vorbis) Init

func (vb *Vorbis) Init(r io.Reader) (err error)

func (*Vorbis) NumTracks

func (vb *Vorbis) NumTracks() int

NumTracks reports track count

func (*Vorbis) Read

func (vb *Vorbis) Read(buf []byte) (n int, err error)

func (*Vorbis) SampleType

func (vb *Vorbis) SampleType() wav.Type

SampleType reporst sample's data type

func (*Vorbis) String

func (vb *Vorbis) String() string

func (*Vorbis) Vendor

func (vb *Vorbis) Vendor() string

Vendor info

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL