File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -138,10 +138,10 @@ impl AtomicF64 {
138138#[ inline( always) ]
139139pub ( crate ) fn assert_valid_sample_rate ( sample_rate : f32 ) {
140140 // Arbitrary cutoffs defined as:
141- // min_sample_rate = min_required_in_spec / 2
142- // max_sample_rate = max_required_in_spec * 2
143- let min_sample_rate = 4_000 .;
144- let max_sample_rate = 192_000 .;
141+ // min_sample_rate = min_required_in_spec / 4
142+ // max_sample_rate = max_required_in_spec * 4
143+ let min_sample_rate = 2_000 .;
144+ let max_sample_rate = 384_000 .;
145145
146146 assert ! (
147147 sample_rate >= min_sample_rate && sample_rate <= max_sample_rate,
@@ -237,13 +237,17 @@ mod tests {
237237 #[ test]
238238 #[ should_panic]
239239 fn test_invalid_sample_rate_too_small ( ) {
240- assert_valid_sample_rate ( 3_000. ) ;
240+ // invalid lower value used in wpt check
241+ // <the-audio-api/the-audiocontext-interface/audiocontextoptions.html>
242+ assert_valid_sample_rate ( 1. ) ;
241243 }
242244
243245 #[ test]
244246 #[ should_panic]
245247 fn test_invalid_sample_rate_too_big ( ) {
246- assert_valid_sample_rate ( 300_000. ) ;
248+ // invalid upper value used in wpt check
249+ // <the-audio-api/the-audiocontext-interface/audiocontextoptions.html>
250+ assert_valid_sample_rate ( 1_000_000. ) ;
247251 }
248252
249253 #[ test]
You can’t perform that action at this time.
0 commit comments