rodio icon indicating copy to clipboard operation
rodio copied to clipboard

Make `DynamicMixer` and `OutputStream` generic

Open eira-fransham opened this issue 11 months ago • 4 comments

This commit adds a new trait, Mixer, and refactors some of the code around generic mixers in order to support it. This is to make more of the code reusable without rewriting - specifically, to support a feature that I would like to implement in bevy_audio where audio sources can send audio to an intermediate mixer. The motivation for this was to add a global limiter to all game audio, so that loud sounds did not cause clipping on the master bus, but another possible usecase would be to split in-game audio and menu audio into separate "worlds" and apply, for example, a low-pass filter while in the pause screen.

eira-fransham avatar Mar 05 '24 13:03 eira-fransham

It looks like the test failures are due to unrelated code, and are because of the addition of redundant import checks to unused_imports.

eira-fransham avatar Mar 05 '24 14:03 eira-fransham

A more-minimal version of this PR would just make OutputStream generic, which would still allow reusing rodio's mixer without adding an actual interface around creating your own.

eira-fransham avatar Mar 05 '24 15:03 eira-fransham

Could you rebase this on main? (or merge main into it). Then you'll get the fixed (thanks @hamirmahal) test suite.

dvdsk avatar Mar 25 '24 22:03 dvdsk

You're welcome, @dvdsk!

hamirmahal avatar Mar 25 '24 22:03 hamirmahal