File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -197,18 +197,11 @@ impl DelayNode {
197
197
"NotSupportedError - maxDelayTime MUST be greater than zero and less than three minutes" ,
198
198
) ;
199
199
200
- // wW internally clamp max delay to quantum duration. This ensure
201
- // that even if the declared max_delay_time and max_delay are smaller
202
- // than quantum duration, the node, if found in a loop, will gracefully
203
- // fallback to the clamped behavior. (e.g. we ensure that ring buffer
204
- // size is always >= 2)
205
- let quantum_duration = 1. / sample_rate * RENDER_QUANTUM_SIZE as f64 ;
206
- let max_delay_time = options. max_delay_time . max ( quantum_duration) ;
207
-
208
- // Allocate large enough buffer to store all delayed samples.
209
- // We add one extra buffer in the ring buffer so that reader never read the
210
- // same entry in history as the writer, even if `delay_time === max_delay_time`
211
- // cf. test_max_delay_multiple_of_quantum_size and test_max_delay
200
+ // Allocate large enough ring buffer to store all delayed samples.
201
+ // We add one extra slot in the ring buffer so that reader never reads the
202
+ // same entry in history as the writer, even if `delay_time == max_delay_time`
203
+ // of if `max_delay_time < quantum duration`
204
+ let max_delay_time = options. max_delay_time ;
212
205
let num_quanta =
213
206
( max_delay_time * sample_rate / RENDER_QUANTUM_SIZE as f64 ) . ceil ( ) as usize ;
214
207
let ring_buffer = Vec :: with_capacity ( num_quanta + 1 ) ;
You can’t perform that action at this time.
0 commit comments