Merge pull request #40 from ltcptgeneral/Squidwarder-patch-1

Squidwarder patch 1 (Fixed both fade_in.m and fade_out.m)
This commit is contained in:
SeaSponge
2021-12-09 19:04:35 -08:00
committed by GitHub
2 changed files with 8 additions and 1 deletions

View File

@@ -22,6 +22,9 @@ function output = fade_in(input, time)
% fade in effect: from no volume to full volume of signal
multiplier = (1 : time) / time;
while length(multiplier) < len
multiplier = [multiplier 1];
end
% the resulting fade-in output
output = input .* multiplier;
end

View File

@@ -24,6 +24,10 @@ function output = fade_out(input, time)
% fade out effect: from full volume of signal to no volume
multiplier = flip(multiplier)
while length(multiplier) < len
multiplier = [multiplier 0];
end
% the resulting fade-in output
output = input .* multiplier;
end