Feature: ChannelRouter
This is an implementation of a multichannel router/mixer source. See #653.
BTW I'm working on a separate project right now to try to profile all these different approaches, once I have that I'll post what I find and then we can move forward with this.
BTW I'm working on a separate project right now to try to profile all these different approaches, once I have that I'll post what I find and then we can move forward with this.
very cool, I'm curious to see if what ends up as best lines up with our suspicions
For mixing several input streams we can use similar class that uses the same algorithm but accepts several Sources at once. Our existing mixer only sums all inputs without any volume adjustments,
For mixing several input streams we can use similar class that uses the same algorithm but accepts several Sources at once. Our existing mixer only sums all inputs without any volume adjustments,
Isn't the better way to do this to have users wrap the streams they are mixing in a Volume struct?
Yes, it is a simpler solution. Maybe we could add and example or make some kind of cookbook.
I was just pondering whether an über-mixer might be useful (the one like in this PR but allowing multiple inputs). For sparse matrix representation this would be straightforward to adapt (or have another more advances version).
By he way, the router in this PR should also handle situation when number of input channels change. At least for current API this is required.
make some kind of cookbook.
I really like that idea! Sink/Player will be easy to use but the power of rodio lies in connecting the sources in an audio pipeline. We could have a bunch of examples but a cookbook is way nicer!
@iluvcapra Would you mind if we merge this PR as is, so we can iterate or improve on this? The implementation can likely be further polished but it seems functional already, but we can have it gated as an experimental API.
I've pulled this up to the upstream, we can merge it or I can keep working on it. I've been doing my active tinkering in my (unpublished) benchmark project but this all works, I've included an example as well.
I've pulled this up to the upstream, we can merge it or I can keep working on it. I've been doing my active tinkering in my (unpublished) benchmark project but this all works, I've included an example as well.
It sounds like your still having fun? As long as that's true keep it up. We can merge it whenever your done with it, we have all the time in the world. If this PR becomes a chore then let us know, we don't want that open source has to be fun.
Just to show what I had in mind in my proposals before #671 (my favorite version).