Mercurial > hg > mauch-mirex-2010
diff _misc/featureextraction/.svn/text-base/readaudiochunk.m.svn-base @ 8:b5b38998ef3b
added all that other stuff
author | matthiasm |
---|---|
date | Fri, 11 Apr 2014 15:54:25 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/_misc/featureextraction/.svn/text-base/readaudiochunk.m.svn-base Fri Apr 11 15:54:25 2014 +0100 @@ -0,0 +1,30 @@ + +% Read in an audio file + + +function [audiodata, info] = readaudiochunk(info) + +fprintf(1,'reading audio chunk\n'); + +% read in wav file + +[rawdata, info.fs] = wavread(info.filename,[info.startsample info.endsample]); + +info.fsdownsampled = info.fs; + +% take average of stereo signals to give one mono audio vector + +meandata = mean(rawdata,2); + +% normalise audio +if max(meandata) > 0.00001 + audiodata = meandata/max(meandata); +else + audiodata = meandata; +end + + + + + +