gopus

package module
v0.0.0-...-0ebf989 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2016 License: Unlicense Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gopus

gopus is a Go binding for the Opus audio codec.

Documentation

Requirements

  • cgo
  • opus development library (only on platforms where the shared library is used)

License

Public domain

Author

Tim Cooper (tim.cooper@layeh.com)

Documentation

Index

Constants

View Source
const (
	BitrateMaximum = C.gopus_bitrate_max
)

Variables

View Source
var (
	ErrBadArgument   = errors.New("bad argument")
	ErrSmallBuffer   = errors.New("buffer is too small")
	ErrInternal      = errors.New("internal error")
	ErrInvalidPacket = errors.New("invalid packet")
	ErrUnimplemented = errors.New("unimplemented")
	ErrInvalidState  = errors.New("invalid state")
	ErrAllocFail     = errors.New("allocation failed")
	ErrUnknown       = errors.New("unknown error")
)

Functions

func CountFrames

func CountFrames(data []byte) (int, error)

Types

type Decoder

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

func NewDecoder

func NewDecoder(sampleRate, channels int) (*Decoder, error)

func (*Decoder) Decode

func (d *Decoder) Decode(data []byte, frameSize int, fec bool) ([]int16, error)

func (*Decoder) ResetState

func (d *Decoder) ResetState()

type Encoder

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

func NewEncoder

func NewEncoder(sampleRate, channels int, application Application) (*Encoder, error)

func (*Encoder) Application

func (e *Encoder) Application() Application

func (*Encoder) Bitrate

func (e *Encoder) Bitrate() int

func (*Encoder) Encode

func (e *Encoder) Encode(pcm []int16, frameSize, maxDataBytes int) ([]byte, error)

func (*Encoder) ResetState

func (e *Encoder) ResetState()

func (*Encoder) SetApplication

func (e *Encoder) SetApplication(application Application)

func (*Encoder) SetBitrate

func (e *Encoder) SetBitrate(bitrate int)

func (*Encoder) SetVbr

func (e *Encoder) SetVbr(vbr bool)

Jump to

Keyboard shortcuts

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