Documentation
¶
Index ¶
Constants ¶
View Source
const ( SampleRate = 48_000 Channels = 2 FrameSamples = 960 FrameBytes = FrameSamples * Channels * 2 MaxPacketBytes = 4_000 DefaultBitrate = 128_000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder adapts the capture process's fixed 48 kHz PCM frames to WebRTC Opus packets. The buffers are owned by the encoder and reused after each Encode call; the returned packet must be consumed before the next call.
func NewEncoder ¶
func (*Encoder) Encode ¶
Encode accepts one interleaved little-endian PCM16 frame and returns an Opus packet backed by the encoder's reusable output buffer.
func (*Encoder) SetBitrate ¶
Click to show internal directories.
Click to hide internal directories.