File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -142,10 +142,6 @@ impl AudioNode for StereoPannerNode {
142
142
1
143
143
}
144
144
145
- fn channel_count_mode ( & self ) -> ChannelCountMode {
146
- ChannelCountMode :: ClampedMax
147
- }
148
-
149
145
fn set_channel_count_mode ( & self , mode : ChannelCountMode ) {
150
146
assert_valid_channel_count_mode ( mode) ;
151
147
self . channel_config . set_count_mode ( mode) ;
@@ -358,6 +354,24 @@ mod tests {
358
354
}
359
355
}
360
356
357
+ #[ test]
358
+ fn test_init_with_channel_count_mode ( ) {
359
+ let context = OfflineAudioContext :: new ( 2 , 1 , 44_100. ) ;
360
+ let options = StereoPannerOptions {
361
+ channel_config : ChannelConfigOptions {
362
+ count_mode : ChannelCountMode :: Explicit ,
363
+ ..ChannelConfigOptions :: default ( )
364
+ } ,
365
+ ..StereoPannerOptions :: default ( )
366
+ } ;
367
+ let panner = StereoPannerNode :: new ( & context, options) ;
368
+ assert_eq ! (
369
+ panner. channel_config( ) . count_mode( ) ,
370
+ ChannelCountMode :: Explicit
371
+ ) ;
372
+ assert_eq ! ( panner. channel_count_mode( ) , ChannelCountMode :: Explicit ) ;
373
+ }
374
+
361
375
#[ test]
362
376
fn test_get_stereo_gains ( ) {
363
377
let sine_table = precomputed_sine_table ( ) ;
You can’t perform that action at this time.
0 commit comments