opus

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT, BSD-3-Clause Imports: 11 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Latency added in v0.2.0

type Latency time.Duration

Latency is a type of OPUS codec frame duration.

const (
	Latency2500us Latency = Latency(2500 * time.Microsecond)
	Latency5ms    Latency = Latency(5 * time.Millisecond)
	Latency10ms   Latency = Latency(10 * time.Millisecond)
	Latency20ms   Latency = Latency(20 * time.Millisecond)
	Latency40ms   Latency = Latency(40 * time.Millisecond)
	Latency60ms   Latency = Latency(60 * time.Millisecond)
)

Latency values available in OPUS codec.

func (Latency) Duration added in v0.2.0

func (l Latency) Duration() time.Duration

Duration returns latency in time.Duration.

func (Latency) Validate added in v0.2.0

func (l Latency) Validate() bool

Validate that the Latency is allowed in OPUS.

type Params

type Params struct {
	codec.BaseParams
	// ChannelMixer is a mixer to be used if number of given and expected channels differ.
	ChannelMixer mixer.ChannelMixer

	// Expected latency of the codec.
	Latency Latency
}

Params stores opus specific encoding parameters.

func NewParams

func NewParams() (Params, error)

NewParams returns default opus codec specific parameters.

func (*Params) BuildAudioEncoder

func (p *Params) BuildAudioEncoder(r audio.Reader, property prop.Media) (codec.ReadCloser, error)

BuildAudioEncoder builds opus encoder with given params

func (*Params) RTPCodec added in v0.1.2

func (p *Params) RTPCodec() *codec.RTPCodec

RTPCodec represents the codec metadata

Jump to

Keyboard shortcuts

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