Mercurial > hg > mauch-mirex-2010
comparison _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 |
comparison
equal
deleted
inserted
replaced
7:12abff5474c8 | 8:b5b38998ef3b |
---|---|
1 | |
2 % Read in an audio file | |
3 | |
4 | |
5 function [audiodata, info] = readaudiochunk(info) | |
6 | |
7 fprintf(1,'reading audio chunk\n'); | |
8 | |
9 % read in wav file | |
10 | |
11 [rawdata, info.fs] = wavread(info.filename,[info.startsample info.endsample]); | |
12 | |
13 info.fsdownsampled = info.fs; | |
14 | |
15 % take average of stereo signals to give one mono audio vector | |
16 | |
17 meandata = mean(rawdata,2); | |
18 | |
19 % normalise audio | |
20 if max(meandata) > 0.00001 | |
21 audiodata = meandata/max(meandata); | |
22 else | |
23 audiodata = meandata; | |
24 end | |
25 | |
26 | |
27 | |
28 | |
29 | |
30 |