serenity-rs / songbird

An async Rust library for the Discord voice API
ISC License
384 stars 110 forks source link

Driver: Use reorder/jitter buffer for audio decoding #146

Closed FelixMcFelix closed 1 year ago

FelixMcFelix commented 2 years ago

For users to correctly handle packet reordering or jitter due to network instability, they currently need to disable our decoding features and reimplement decoding logic themselves -- this gets more complex when handling audio data from several users, which is interspersed and can arrive at different parts of each 20ms window. This makes downmixing particular nasty.

Ideally, we should take this complexity on ourselves. Doing so will require a few changes: