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
commit 90e03cb118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 % fade in effect: from no volume to full volume of signal
multiplier = (1 : time) / time; multiplier = (1 : time) / time;
while length(multiplier) < len
multiplier = [multiplier 1];
end
% the resulting fade-in output % the resulting fade-in output
output = input .* multiplier; output = input .* multiplier;
end end

View File

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