opus

package
v3.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AppRestrictedLowDelay optimizes encoding for low latency applications
	AppRestrictedLowDelay = Application(C.OPUS_APPLICATION_RESTRICTED_LOWDELAY)
	// FullBand is 20 kHz bandpass
	FullBand = Bandwidth(C.OPUS_BANDWIDTH_FULLBAND)
)

Variables

This section is empty.

Functions

func CodecVersion

func CodecVersion() string

Types

type Application

type Application int

type Bandwidth

type Bandwidth int

type Bitrate

type Bitrate int

type Encoder

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

func NewEncoder

func NewEncoder(outFq int) (*Encoder, error)

func (*Encoder) Bitrate

func (e *Encoder) Bitrate() (int, error)

Bitrate returns the bitrate of the encoder.

func (*Encoder) Complexity

func (e *Encoder) Complexity() (int, error)

Complexity returns the value of the complexity.

func (*Encoder) DTX

func (e *Encoder) DTX() (bool, error)

DTX says if discontinuous transmission is enabled.

func (*Encoder) Encode

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

func (*Encoder) FEC

func (e *Encoder) FEC() (bool, error)

FEC says if forward error correction (FEC) is enabled.

func (*Encoder) GetInfo

func (e *Encoder) GetInfo() string

func (*Encoder) MaxBandwidth

func (e *Encoder) MaxBandwidth() (Bandwidth, error)

MaxBandwidth returns the maximum allowed bandpass value.

func (*Encoder) PacketLossPerc

func (e *Encoder) PacketLossPerc() (int, error)

PacketLossPerc returns configured packet loss percentage.

func (*Encoder) Reset

func (e *Encoder) Reset() error

func (*Encoder) ResetState

func (e *Encoder) ResetState() error

func (*Encoder) SampleRate

func (e *Encoder) SampleRate() (int, error)

SampleRate returns the sample rate of the encoder.

func (*Encoder) SetBitrate

func (e *Encoder) SetBitrate(b Bitrate) error

SetBitrate sets the bitrate of the encoder. BitrateMax / BitrateAuto can be used here.

func (*Encoder) SetComplexity

func (e *Encoder) SetComplexity(complexity int) error

SetComplexity sets the complexity factor for the encoder. Complexity is a value from 1 to 10, where 1 is the lowest complexity and 10 is the highest.

func (*Encoder) SetDTX

func (e *Encoder) SetDTX(dtx bool) error

SetDTX switches discontinuous transmission.

func (*Encoder) SetFEC

func (e *Encoder) SetFEC(fec bool) error

SetFEC switches the forward error correction (FEC).

func (*Encoder) SetMaxBandwidth

func (e *Encoder) SetMaxBandwidth(b Bandwidth) error

SetMaxBandwidth sets the upper limit of the bandpass.

func (*Encoder) SetPacketLossPerc

func (e *Encoder) SetPacketLossPerc(lossPerc int) error

SetPacketLossPerc sets expected packet loss percentage.

type Error

type Error int

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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