rodio icon indicating copy to clipboard operation
rodio copied to clipboard

Fixed ChannelVolume size_hint and added tests

Open dbartussek opened this issue 3 years ago • 0 comments

The current implementation of size_hint for ChannelVolume is broken for two reasons:

1. The number of samples in input and result should be the same, but each sample may produce more or less elements if channel count differs

To fix this, the size hint is first divided by the source channel count, then multiplied by the result channel count.

2. The sample currently being emitted is not taken into account

To fix this, we add how many times we will emit self.current_sample (=> How many channels still remain for this sample).

dbartussek avatar Sep 11 '22 23:09 dbartussek