Discord: fix captions silently stopping after encryption key changes #5
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
khyretos/voice-translator!5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/practical-darwin-vrjmvc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes Discord captions silently stopping (log:
decode error … Invalid packet) until the service was restarted.Cause: each speaker's Opus stream was piped into a prism
Decoderstream. While Discord's end-to-end voice encryption (DAVE) changes keys (someone joins or leaves, the bot is moved),@discordjs/voicepasses a few still-encrypted packets through. The first one made the decoder error out and destroyed it. The subscription stayed registered, so that speaker was never re-subscribed and their audio was dropped from then on. Reproduced locally: after one corrupt packet only 1 of the next 21 valid packets was decoded.Fix:
discord_bridge/audio.js:@discordjs/opus,opusscriptfallback) and skip undecodable packets. The Opus stream is read in flowing mode, so it always ends after silence and the next utterance gets a fresh stream.Dockerfilecopies alldiscord_bridge/*.js, including the newaudio.js.Testing
🤖 Generated with Claude Code
https://claude.ai/code/session_01Hr7di2bGC8qCojX7XXQbGx
Generated by Claude Code