Mercurial > hg > audio-degradation-toolbox
annotate testdata/normalizeAllWavFiles.m @ 11:2d0ed50c547f version 0.11
Removed tag version 0.11
author | matthiasm |
---|---|
date | Wed, 21 Aug 2013 19:18:43 +0100 |
parents | 9d682f5e3927 |
children |
rev | line source |
---|---|
matthiasm@0 | 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
matthiasm@0 | 2 % Audio Degradation Toolbox |
matthiasm@0 | 3 % |
matthiasm@0 | 4 % Centre for Digital Music, Queen Mary University of London. |
matthiasm@0 | 5 % This file copyright 2013 Sebastian Ewert, Matthias Mauch and QMUL. |
matthiasm@0 | 6 % |
matthiasm@0 | 7 % This program is free software; you can redistribute it and/or |
matthiasm@0 | 8 % modify it under the terms of the GNU General Public License as |
matthiasm@0 | 9 % published by the Free Software Foundation; either version 2 of the |
matthiasm@0 | 10 % License, or (at your option) any later version. See the file |
matthiasm@0 | 11 % COPYING included with this distribution for more information. |
matthiasm@0 | 12 % |
matthiasm@0 | 13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
matthiasm@0 | 14 |
matthiasm@0 | 15 clear |
matthiasm@0 | 16 |
matthiasm@0 | 17 dirInfo = dir('*.wav'); |
matthiasm@0 | 18 |
matthiasm@0 | 19 for k=1:length(dirInfo) |
matthiasm@0 | 20 filename = dirInfo(k).name; |
matthiasm@0 | 21 [y,fs,nbits] = wavread(filename); |
matthiasm@0 | 22 |
matthiasm@0 | 23 gain = 0.99 / max(max(abs(y))); |
matthiasm@0 | 24 |
matthiasm@0 | 25 wavwrite(y * gain,fs,24,filename); |
matthiasm@0 | 26 end |