Documentation
¶
Index ¶
- Constants
- func Encode(w Writer, channels int, logger logger.Logger) (media.PCM16Writer, error)
- func EncodeWith(w Writer, channels int, opts EncodeOptions, logger logger.Logger) (media.PCM16Writer, error)
- func NewWebmWriter(w io.WriteCloser, sampleRate int, channels int, sampleDur time.Duration) media.WriteCloser[Sample]
- type EncodeOptions
- type Sample
- type Writer
Constants ¶
View Source
const ( SDPNameOnly = "opus" SDPName = SDPNameOnly + "/48000/2" )
Variables ¶
This section is empty.
Functions ¶
func EncodeWith ¶
func EncodeWith(w Writer, channels int, opts EncodeOptions, logger logger.Logger) (media.PCM16Writer, error)
func NewWebmWriter ¶
func NewWebmWriter(w io.WriteCloser, sampleRate int, channels int, sampleDur time.Duration) media.WriteCloser[Sample]
Types ¶
type EncodeOptions ¶
type EncodeOptions struct {
// Bitrate is the target encoder bitrate in bits/sec (e.g. 24000). 0 = auto.
Bitrate int
// Complexity is the encoder computational complexity 1-10. 0 = default.
Complexity int
// FEC enables in-band Forward Error Correction.
FEC bool
// PacketLossPercent is the expected packet loss 0-100, used to tune FEC.
PacketLossPercent int
}
EncodeOptions tunes the Opus encoder. Zero values keep libopus defaults.
Click to show internal directories.
Click to hide internal directories.