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 {
138
138
#[ inline( always) ]
139
139
pub ( crate ) fn assert_valid_sample_rate ( sample_rate : f32 ) {
140
140
// 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 .;
145
145
146
146
assert ! (
147
147
sample_rate >= min_sample_rate && sample_rate <= max_sample_rate,
@@ -237,13 +237,17 @@ mod tests {
237
237
#[ test]
238
238
#[ should_panic]
239
239
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. ) ;
241
243
}
242
244
243
245
#[ test]
244
246
#[ should_panic]
245
247
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. ) ;
247
251
}
248
252
249
253
#[ test]
You can’t perform that action at this time.
0 commit comments