comparison src/SoundFileLoader.h @ 2:fa2af670b5c5 tip

SoundFileLoader might have moved
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Fri, 06 Jan 2012 00:23:26 +0000
parents
children
comparison
equal deleted inserted replaced
1:ba2a17cf81bf 2:fa2af670b5c5
1 /*
2 * SoundFileLoader.h
3 * audioFileLoaderSVN1
4 *
5 * Created by Andrew on 04/09/2011.
6 * Copyright 2011 QMUL. All rights reserved.
7 *
8 */
9
10 #ifndef SOUND_FILE_LOADER_H
11 #define SOUND_FILE_LOADER_H
12
13
14 #include "fftw3.h"
15 #include "ofMain.h"
16 #include "sndfile.h"
17 #include "AudioFile.h"
18 #include "AudioAnalysis.h"
19 #include "chromaGram.h"
20 #include "ChordDetect.h"
21
22 #define FRAMESIZE 512
23 #define ENERGY_LENGTH 80000
24 #define CHROMA_LENGTH 12000
25 #define CHROMA_CONVERSION_FACTOR 16 //16 times as many frames in energy as in chroma
26
27
28 //this does a chromagram analysis and aubio onset analysis
29 //held in double matrix and doubleVector respectively
30 //these are dynamic vectors, so size set by what's needed for the file
31
32 class SoundFileLoader{
33
34 public:
35 SoundFileLoader();
36 float frame[FRAMESIZE];
37
38 void loadLibSndFile(const char *infilename);
39
40 AudioFile audioHolder;
41 AudioAnalysis chromaAnalysis;
42 Chromagram chromoGramm;
43 Chromagram* chromaG;
44
45 typedef std::vector<double> DoubleVector;
46 typedef std::vector<DoubleVector> DoubleMatrix;
47
48 void processAudioToDoubleMatrix();
49 double getEnergyOfFrame();
50
51 int totalNumberOfFrames;
52
53 SNDFILE *infile; // define input and output sound files
54 SF_INFO sfinfo ; // struct to hold info about sound file
55
56 };
57 #endif