File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ use std::sync::OnceLock;
15
15
const SAMPLE_RATE : f32 = 48000. ;
16
16
const DURATION : usize = 10 ;
17
17
const SAMPLES : usize = SAMPLE_RATE as usize * DURATION ;
18
+ const SAMPLES_SHORT : usize = SAMPLE_RATE as usize ; // only 1 second for heavy benchmarks
18
19
19
20
/// Load an audio buffer and cache the result
20
21
///
@@ -220,7 +221,7 @@ pub fn bench_analyser_node() {
220
221
}
221
222
222
223
pub fn bench_hrtf_panners ( ) {
223
- let ctx = OfflineAudioContext :: new ( 2 , black_box ( SAMPLES ) , SAMPLE_RATE ) ;
224
+ let ctx = OfflineAudioContext :: new ( 2 , black_box ( SAMPLES_SHORT ) , SAMPLE_RATE ) ;
224
225
225
226
let mut panner1 = ctx. create_panner ( ) ;
226
227
panner1. set_panning_model ( PanningModelType :: HRTF ) ;
@@ -237,7 +238,7 @@ pub fn bench_hrtf_panners() {
237
238
osc. connect ( & panner2) ;
238
239
osc. start ( ) ;
239
240
240
- assert_eq ! ( ctx. start_rendering_sync( ) . length( ) , SAMPLES ) ;
241
+ assert_eq ! ( ctx. start_rendering_sync( ) . length( ) , SAMPLES_SHORT ) ;
241
242
}
242
243
243
244
#[ cfg( feature = "iai" ) ]
You can’t perform that action at this time.
0 commit comments