mirror of
https://github.com/RustAudio/rodio
synced 2024-11-10 06:04:16 +00:00
Added assertion to guard against 0-duration ramps
This commit is contained in:
parent
184bb05454
commit
9c0706afbf
1 changed files with 4 additions and 3 deletions
|
@ -15,12 +15,13 @@ where
|
|||
I: Source,
|
||||
I::Item: Sample,
|
||||
{
|
||||
let duration = duration.as_secs() * 1000000000 + duration.subsec_nanos() as u64;
|
||||
let duration_nanos = duration.as_secs() * 1000000000 + duration.subsec_nanos() as u64;
|
||||
assert!(duration_nanos > 0);
|
||||
|
||||
LinearGainRamp {
|
||||
input,
|
||||
remaining_ns: duration as f32,
|
||||
total_ns: duration as f32,
|
||||
remaining_ns: duration_nanos as f32,
|
||||
total_ns: duration_nanos as f32,
|
||||
start_gain,
|
||||
end_gain,
|
||||
clamp_end
|
||||
|
|
Loading…
Reference in a new issue