File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -393,6 +393,25 @@ impl PannerNode {
393
393
panning_model,
394
394
} = options;
395
395
396
+ assert ! (
397
+ ref_distance >= 0. ,
398
+ "RangeError - refDistance cannot be negative"
399
+ ) ;
400
+ assert ! (
401
+ max_distance > 0. ,
402
+ "RangeError - maxDistance must be positive"
403
+ ) ;
404
+ assert ! (
405
+ rolloff_factor >= 0. ,
406
+ "RangeError - rolloffFactor cannot be negative"
407
+ ) ;
408
+ assert ! (
409
+ cone_outer_gain >= 0. && cone_outer_gain <= 1. ,
410
+ "InvalidStateError - coneOuterGain must be in the range [0, 1]"
411
+ ) ;
412
+ assert_valid_channel_count ( channel_config. count ) ;
413
+ assert_valid_channel_count_mode ( channel_config. count_mode ) ;
414
+
396
415
// position params
397
416
let ( param_px, render_px) = context. create_audio_param ( PARAM_OPTS , & registration) ;
398
417
let ( param_py, render_py) = context. create_audio_param ( PARAM_OPTS , & registration) ;
@@ -540,7 +559,7 @@ impl PannerNode {
540
559
///
541
560
/// Panics if the provided value is negative.
542
561
pub fn set_max_distance ( & mut self , value : f64 ) {
543
- assert ! ( value >= 0. , "RangeError - maxDistance cannot be negative " ) ;
562
+ assert ! ( value > 0. , "RangeError - maxDistance must be positive " ) ;
544
563
self . max_distance = value;
545
564
self . registration
546
565
. post_message ( ControlMessage :: MaxDistance ( value) ) ;
You can’t perform that action at this time.
0 commit comments