Mercurial > hg > ape
diff aux/mono2stereo.m @ 0:4fd284285159
Adding listening test plus some helpful functions and scripts.
author | Brecht <b.deman@qmul.ac.uk> |
---|---|
date | Thu, 24 Apr 2014 23:53:31 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/aux/mono2stereo.m Thu Apr 24 23:53:31 2014 +0100 @@ -0,0 +1,19 @@ +function mono2stereo(folder) +% MONO2STEREO join any two mono files in folder ending on 'L' and 'R' to +% one stereo file +% +% by Brecht De Man at Centre for Digital Music, 22 May 2013 + +list = dir([folder '/*.wav']); +for i = 2:length(list) + if strcmp(list(i).name(1:end-4), [list(i-1).name(1:end-5) 'R']) + if strcmp(list(i-1).name(1:end-4), [list(i).name(1:end-5) 'L']) + [L,fs] = audioread([folder '/' list(i-1).name]); + R = audioread([folder '/' list(i).name]); + audiowrite([folder '/' list(i).name(1:end-5) '.wav'], [L,R], fs, 'BitsPerSample', 24); + delete([folder '/' list(i-1).name], [folder '/' list(i).name]); % delete original files + end + end +end + +end \ No newline at end of file