Documentation
¶
Overview ¶
Package broadcast streams the player's audio into a Discord voice channel.
Package stream sends an engine's output to a Discord voice socket as Opus, paced by the wall clock: shared by dotamp's broadcast and the house bot.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSetup = errors.New("stream setup")
ErrSetup wraps a failure to build the Opus encoder.
var Silence = []byte{0xF8, 0xFF, 0xFE}
Silence is the Opus packet Discord documents for keeping a stream warm while nothing plays.
Functions ¶
Types ¶
type Pacer ¶
type Pacer struct {
// contains filtered or unexported fields
}
Pacer hands out 20 ms slots against the wall clock, so a late tick sends what it owes instead of letting the stream slip behind one slot per miss.
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline turns engine-rate stereo float32 into 20 ms Opus packets.
func NewPipeline ¶
type Speaker ¶
type Speaker struct {
// contains filtered or unexported fields
}
Speaker decides, tick by tick, whether to send audio, one of Discord's silence frames, or nothing. The speaking flag is set once at join and never dropped: clearing it and raising it again was found to kill the stream on Discord's side (live test, 2026-10-17), while a run of silence frames followed by nothing resumes cleanly.