File tree Expand file tree Collapse file tree 4 files changed +11
-13
lines changed Expand file tree Collapse file tree 4 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -649,7 +649,11 @@ impl AudioProcessor for BiquadFilterRenderer {
649
649
} ;
650
650
651
651
for ( channel_number, output_channel) in output. channels_mut ( ) . iter_mut ( ) . enumerate ( ) {
652
- let input_channel = input. channel_data ( channel_number) ;
652
+ let input_channel = if input. is_silent ( ) {
653
+ input. channel_data ( 0 )
654
+ } else {
655
+ input. channel_data ( channel_number)
656
+ } ;
653
657
// retrieve state from previous block
654
658
let mut x1 = self . x1 [ channel_number] ;
655
659
let mut x2 = self . x2 [ channel_number] ;
Original file line number Diff line number Diff line change @@ -1142,7 +1142,6 @@ mod tests {
1142
1142
let panner = PannerNode :: new ( & context, options) ;
1143
1143
assert_eq ! ( panner. panning_model( ) , PanningModelType :: EqualPower ) ;
1144
1144
panner. position_y ( ) . set_value ( 1. ) ; // sound comes from above
1145
- panner. set_channel_count ( 1 ) ;
1146
1145
1147
1146
src. connect ( & panner) ;
1148
1147
panner. connect ( & context. destination ( ) ) ;
@@ -1181,8 +1180,11 @@ mod tests {
1181
1180
listener. up_y ( ) . set_value ( 0. ) ;
1182
1181
listener. up_z ( ) . set_value ( 1. ) ;
1183
1182
1184
- // 128 input samples of value 1.
1185
- let input = AudioBuffer :: from ( vec ! [ vec![ 1. ; RENDER_QUANTUM_SIZE ] ] , sample_rate) ;
1183
+ // 128 input samples of value 1, stereo
1184
+ let input = AudioBuffer :: from (
1185
+ vec ! [ vec![ 1. ; RENDER_QUANTUM_SIZE ] , vec![ 1. ; RENDER_QUANTUM_SIZE ] ] ,
1186
+ sample_rate,
1187
+ ) ;
1186
1188
let mut src = AudioBufferSourceNode :: new ( & context, AudioBufferSourceOptions :: default ( ) ) ;
1187
1189
src. set_buffer ( input) ;
1188
1190
src. start ( ) ;
Original file line number Diff line number Diff line change @@ -417,14 +417,6 @@ impl Graph {
417
417
// acquire a mutable borrow of the current processing node
418
418
let mut node = nodes[ * index] . borrow_mut ( ) ;
419
419
420
- // make sure all input buffers have the correct number of channels, this might not be
421
- // the case if the node has no inputs connected or the channel count has just changed
422
- let interpretation = node. channel_config . interpretation ( ) ;
423
- let count = node. channel_config . count ( ) ;
424
- node. inputs
425
- . iter_mut ( )
426
- . for_each ( |i| i. mix ( count, interpretation) ) ;
427
-
428
420
// let the current node process (catch any panics that may occur)
429
421
let params = AudioParamValues :: from ( nodes) ;
430
422
scope. node_id . set ( * index) ;
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ fn test_stereo_to_discrete_stereo() {
93
93
94
94
assert_eq ! ( output. number_of_channels( ) , 2 ) ;
95
95
assert_float_eq ! ( output. get_channel_data( 0 ) , ONES , abs_all <= 0. ) ;
96
- assert_float_eq ! ( output. get_channel_data( 1 ) , ONES , abs_all <= 0. ) ;
96
+ assert_float_eq ! ( output. get_channel_data( 1 ) , ZEROES , abs_all <= 0. ) ;
97
97
}
98
98
99
99
#[ test]
You can’t perform that action at this time.
0 commit comments