opus

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT, BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Latency

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

func (l Latency) Duration() time.Duration

Duration returns latency in time.Duration.

func (Latency) Validate

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

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