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

@ -21,7 +21,10 @@ function output = fade_in(input, time)
% set multiplier as 1D array
% 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

@ -23,6 +23,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;