vorbis

package module
v0.0.0-...-5f1f544 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2014 License: BSD-3-Clause Imports: 4 Imported by: 1

README

vorbis

Go implementation of libvorbis 1.3.3. See [www.xiph.org/vorbis] for more info about libvorbis.

So far only the vorbis encoding works.

See also https://github.com/runningwild/gorbis for a pure Go implementation.

Documentation

Overview

Package vorbis contains the Vorbis reference encoder and decoder. This is the low-level interface. If you only want to extract audio from an Ogg Vorbis file, you probably want to use the vorbisfile package.

Index

Constants

View Source
const (
	FALSE      = -1
	EOF        = -2
	HOLE       = -3
	EREAD      = -128
	EFAULT     = -129
	EIMPL      = -130
	EINVAL     = -131
	ENOTVORBIS = -132
	EBADHEADER = -133
	EVERSION   = -134
	ENOTAUDIO  = -135
	EBADPACKET = -136
	EBADLINK   = -137
	ENOSEEK    = -138
)

Vorbis ERRORS and return codes

Variables

This section is empty.

Functions

func Analysis

func Analysis(vb *Block, op *ogg.Packet) int

func AnalysisBlockOut

func AnalysisBlockOut(v *DspState, vb *Block) int

func AnalysisBuffer

func AnalysisBuffer(v *DspState, vals int) [][]float32

func AnalysisHeaderOut

func AnalysisHeaderOut(v *DspState, vc *Comment, op, op_comm, op_code *ogg.Packet) int

func AnalysisInit

func AnalysisInit(v *DspState, vi *Info) int

func AnalysisSetBufferItem

func AnalysisSetBufferItem(v *DspState, channel int, offset int, value float32)

func AnalysisWrote

func AnalysisWrote(v *DspState, vals int) int

func BitrateAddBlock

func BitrateAddBlock(vb *Block) int

func BitrateFlushPacket

func BitrateFlushPacket(vd *DspState, op *ogg.Packet) int

func GranuleTime

func GranuleTime(v *DspState, granulepos int64) float64

func PacketBlocksize

func PacketBlocksize(vi *Info, op *ogg.Packet) int32

func PcmArrayHelper

func PcmArrayHelper(pcm **float32, channel, offset int) float32

This helper function is to solve the problems with C-arrays and Go. To avoid these problems, the C-array is just called from within C, for each value of the array.

func Synthesis

func Synthesis(vb *Block, op *ogg.Packet) int

func SynthesisBlockin

func SynthesisBlockin(v *DspState, vb *Block) int

func SynthesisHalfrate

func SynthesisHalfrate(v *Info, flag bool) int

func SynthesisHalfrateP

func SynthesisHalfrateP(v *Info) (result bool)

func SynthesisHeaderIn

func SynthesisHeaderIn(vi *Info, vc *Comment, op *ogg.Packet) int

func SynthesisIdHeader

func SynthesisIdHeader(op *ogg.Packet) int

func SynthesisInit

func SynthesisInit(v *DspState, vi *Info) int

func SynthesisLapOut

func SynthesisLapOut(v *DspState, pcm ***float32) int

func SynthesisPcmout

func SynthesisPcmout(v *DspState, pcm ***float32) int

func SynthesisRead

func SynthesisRead(v *DspState, samples int) int

func SynthesisRestart

func SynthesisRestart(v *DspState) int

func SynthesisTrackOnly

func SynthesisTrackOnly(vb *Block, op *ogg.Packet) int

func VersionString

func VersionString() string

Types

type Block

type Block C.vorbis_block

Block struct holds the data for a single block of audio.

func (*Block) Clear

func (p *Block) Clear() int

func (*Block) Init

func (p *Block) Init(v *DspState) int

type Comment

type Comment C.vorbis_comment

Comment struct defines an Ogg Vorbis comment.

func (*Comment) Add

func (p *Comment) Add(comment string)

func (*Comment) AddTag

func (p *Comment) AddTag(tag string, contents string)

func (*Comment) Clear

func (p *Comment) Clear()

func (*Comment) HeaderOut

func (p *Comment) HeaderOut(op *ogg.Packet) int

func (*Comment) Init

func (p *Comment) Init()

func (*Comment) Query

func (p *Comment) Query(tag string, count int) string

func (*Comment) QueryCount

func (p *Comment) QueryCount(tag string) int

func (*Comment) UserComments

func (p *Comment) UserComments() (UserComments []string)

func (*Comment) Vendor

func (p *Comment) Vendor() string

type DspState

type DspState C.vorbis_dsp_state

DspState struct is the state for one instance of a Vorbis encoder or decoder.

func (*DspState) Clear

func (p *DspState) Clear()

func (*DspState) Info

func (dspState *DspState) Info() *Info

func (*DspState) Sequence

func (dspState *DspState) Sequence() int64

type Info

type Info C.vorbis_info

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

func (*Info) BlockSize

func (p *Info) BlockSize(zo int16) int16

func (*Info) Channels

func (p *Info) Channels() (channels int16)

func (*Info) Clear

func (p *Info) Clear()

func (*Info) Init

func (p *Info) Init()

func (*Info) Rate

func (p *Info) Rate() (rate int32)

Directories

Path Synopsis
examples
ovenc
Function: simple example encoder Takes a stereo 16bit 44.1kHz WAV file from stdin and encodes it into a Vorbis bitstream
Function: simple example encoder Takes a stereo 16bit 44.1kHz WAV file from stdin and encodes it into a Vorbis bitstream

Jump to

Keyboard shortcuts

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