opus

package module
v0.0.0-...-1a1ffdb Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2014 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Encode raw pcm to opus (ogg) audio with cgo libopus binding.

Index

Constants

View Source
const (
	APPLICATION_VOIP                = 2048
	APPLICATION_AUDIO               = 2049
	APPLICATION_RESTRICTED_LOWDELAY = 2051
	FRAMING_NONE                    = 0
	FRAMING_OGG                     = 1
)

Variables

View Source
var DefaultConfig = EncoderConfig{48000, 2, APPLICATION_AUDIO, FRAMING_OGG}

Functions

This section is empty.

Types

type Encoder

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

func NewEncoder

func NewEncoder(c EncoderConfig) (*Encoder, error)

func (*Encoder) Close

func (e *Encoder) Close()

func (*Encoder) CreateSilence

func (e *Encoder) CreateSilence(d time.Duration) (*Silence, error)

func (*Encoder) EncodeFloat

func (e *Encoder) EncodeFloat(input []float32) ([]byte, error)

func (*Encoder) EncodeInt16

func (e *Encoder) EncodeInt16(input []int16) ([]byte, error)

func (*Encoder) EncodeRaw

func (e *Encoder) EncodeRaw(input []byte) ([]byte, error)

func (*Encoder) EncodeSilence

func (e *Encoder) EncodeSilence(s *Silence) ([]byte, error)

func (*Encoder) StreamHeader

func (e *Encoder) StreamHeader() []byte

type EncoderConfig

type EncoderConfig struct {
	SamplingRate int
	Channels     int
	Application  int
	Framing      int
}

type Silence

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

Jump to

Keyboard shortcuts

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