RustAudio / cpal

Cross-platform audio I/O library in pure Rust
Apache License 2.0
2.71k stars 361 forks source link

Suggestion: Add Mixer functionality #436

Open sniperrifle2004 opened 4 years ago

sniperrifle2004 commented 4 years ago

Due to the wide variety of Devices there is an equally wide range of capabilities. Specifically the device in question might not support mixing. Which means that there is no guaranteed possibility of doing multiple output streams.

I'm not wholly convinced this is cpal's job to solve, but it could be addressed by introducing a Mixer device that wraps around a device and provides the necessary functionality. To keep it simple though I do suggest this device limit the possible output configurations to one (Specified initially) otherwise the complexity goes up quite a bit. That way you can reliably create multiple output streams targeted at any device.

mitchmindtree commented 4 years ago

Hey thanks for raising this @sniperrifle2004!

I'm not wholly convinced this is cpal's job to solve

I'm very much with you here, I think we're better off keeping CPAL's scope as minimal as possible (e.g. purely the necessities for cross-platform audio I/O) and allowing other crates to emerge and solve these things on top. E.g. there is already dsp-chain, rodio, (edit: and now dasp_graph) and I'm sure many many other different audio routing crates to suit different needs that can extend cpal.