serenity-rs / songbird

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

Driver: remove sample buffer copy for softclip #143

Closed FelixMcFelix closed 1 year ago

FelixMcFelix commented 2 years ago

This PR makes use of SampleBuffer::samples_mut to remove a 7680B stack allocation in general, and memcopy when softclip is used. This appears to offer ~1.5% performance boost according to cargo make bench.

This is a draft PR conditioned on the relevant symphonia API change becoming available.