File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ mod test {
139139 /// - Practical audio range (-60dB to +40dB): max errors ~1x ε
140140 /// - Extended range (-100dB to +100dB): max errors ~2.3x ε
141141 /// - Extreme edge cases beyond ±100dB have larger errors but are rarely used
142-
142+ ///
143143 /// Based on [Wikipedia's Decibel article].
144144 ///
145145 /// [Wikipedia's Decibel article]: https://web.archive.org/web/20230810185300/https://en.wikipedia.org/wiki/Decibel
Original file line number Diff line number Diff line change @@ -177,7 +177,9 @@ impl MixerSource {
177177 let mut pending = self . input . 0 . pending_sources . lock ( ) . unwrap ( ) ; // TODO: relax ordering?
178178
179179 for source in pending. drain ( ..) {
180- let in_step = self . sample_count % source. channels ( ) . get ( ) as usize == 0 ;
180+ let in_step = self
181+ . sample_count
182+ . is_multiple_of ( source. channels ( ) . get ( ) as usize ) ;
181183
182184 if in_step {
183185 self . current_sources . push ( source) ;
Original file line number Diff line number Diff line change 8888 factor = self . start_gain * ( 1.0f32 - p) + self . end_gain * p;
8989 }
9090
91- if self . sample_idx % ( self . channels ( ) . get ( ) as u64 ) == 0 {
91+ if self . sample_idx . is_multiple_of ( self . channels ( ) . get ( ) as u64 ) {
9292 self . elapsed_ns += 1000000000.0 / ( self . input . sample_rate ( ) . get ( ) as f32 ) ;
9393 }
9494
You can’t perform that action at this time.
0 commit comments