diff aux/clipfade.m @ 6:ed0a8621b96a

prepare2listen small fixes, manual, standard target loudness (-23 dBLUFS)
author Brecht De Man <b.deman@qmul.ac.uk>
date Mon, 24 Nov 2014 16:55:55 +0000
parents b28ffd29e6e1
children 22964a1dc292
line wrap: on
line diff
--- a/aux/clipfade.m	Sun Nov 23 23:24:35 2014 +0000
+++ b/aux/clipfade.m	Mon Nov 24 16:55:55 2014 +0000
@@ -9,7 +9,7 @@
 % by Brecht De Man at Centre for Digital Music on 25 October 2013
 
 if nargin < 6
-    bitDepth = 24;
+    bitdepth = 24;
 end
 slash    = '/';
 
@@ -26,23 +26,18 @@
 end
 
 for i = 1:length(list)
-    if strcmp(list(i).name, 'bounce.wav')
-        %disp(['     ' folder slash list(i).name]); % DEBUG 
-
-        [audio,fsfile] = audioread([folder slash list(i).name], [startTime*fs+1 endTime*fs]); % read part of file
+        [audio,fsfile] = audioread([folder slash list(i).name], [starttime*fs+1 endtime*fs]); % read part of file
         assert(fsfile == fs); % check file has expected sampling rate
 
-        Nfade = fadeTime*fs; % make fade vector (based on sampling rate)
-        fadeVector = [(1:Nfade)/Nfade ones(1,length(audio)-2*Nfade) (Nfade:-1:1)/Nfade];
+        Nfade = fadetime*fs; % make fade vector (based on sampling rate)
+        fadevector = [(1:Nfade)/Nfade ones(1,length(audio)-2*Nfade) (Nfade:-1:1)/Nfade];
 
         % apply fading and write to new folder
         if size(audio,2) == 2 % if stereo
             audiowrite([folder slash list(i).name], ... %[folder slash newFolder slash list(i).name]
-                [fadeVector'.*audio(:,1) fadeVector'.*audio(:,2)], fs, 'BitsPerSample', bitDepth);
+                [fadevector'.*audio(:,1) fadevector'.*audio(:,2)], fs, 'BitsPerSample', bitdepth);
         else % if mono
             audiowrite([folder slash list(i).name], ... %[folder slash newFolder slash list(i).name]
-                fadeVector'.*audio, fs, 'BitsPerSample', bitDepth);
+                fadevector'.*audio, fs, 'BitsPerSample', bitdepth);
         end
-    
-    end
 end
\ No newline at end of file