Conversation
|
|
||
| /// Converts between two channel counts, created using | ||
| /// [with_channel_count](ConstSource::with_channel_count) | ||
| pub struct ChannelConvertor<const SR: u32, const CH_IN: u16, const CH_OUT: u16, S> { |
There was a problem hiding this comment.
As I understand this is intended as 1-to-1 rewrite, just keeping old functionality?
We had discussion a while ago regarding this source, in some cases just dropping channels is not enough, it may require some mixing to work properly. (see e.g. #671 - which I fancy to necromance).
| pos: usize, | ||
| } | ||
|
|
||
| impl<const SR: u32, const CH: u16> SamplesBuffer<SR, CH> { |
There was a problem hiding this comment.
Maybe it was discussed already,, but why not SampleRate?
|
|
||
| /// Converts between two channel counts, created using | ||
| /// [with_channel_count](ConstSource::with_channel_count) | ||
| pub struct ChannelConvertor<const SR: u32, const CH_IN: u16, const CH_OUT: u16, S> { |
There was a problem hiding this comment.
Was this intended as just refactoring (keeping old behavior)?
I just wanted to note that we had discussion a while ago regarding this, and in some cases properly converting number of channels requires some mixing (se e.g. #656 which I fancy to necromance).
| impl<const SR: u32, const CH: u16> std::fmt::Display for ParameterMismatch<SR, CH> { | ||
| fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
| if self.sample_rate.get() == SR && self.channel_count.get() == CH { | ||
| unreachable!("ParameterMismatch error can only occur when params mismatch"); |
There was a problem hiding this comment.
// Well, it is reachable, just not expected, assert, maybe?
review after #904 (this includes it's changes)
Tracking issue: #901