Mercurial > hg > audio-file-loader
view src/AudioFile.h @ 1:ba2a17cf81bf
first working version of audio file loder. Loads bach clip from the apps->audio-file-loader->bin->data->sounds foler. Three classes: SoundFileLoader does the loading and parsing of thefile with libSndFile. audio samples are kept in AudioFile and analysis of features are kept in AudioAnalysis, at this stage just chromagramm and basic energy
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Sun, 04 Sep 2011 22:45:35 +0100 |
parents | bcb0d40158f4 |
children |
line wrap: on
line source
/* * audioFile.h * audioFileLoader3 * * Created by Andrew on 31/07/2011. * Copyright 2011 QMUL. All rights reserved. * */ //Holds the actual samples loaded in from the audio file //in a double matrix, so multilpe channels used #ifndef AUDIOFILE_H #define AUDIOFILE_H #include "ofMain.h" //fix bug where drawn before the start high up class AudioFile { public: AudioFile(); // constructor // ~AudioFile(); void drawAudioVectorMillis(double startTimeMillis, double endTimeMillis); void drawAudioVectorSamples(double startTimeSample, double endTimeSample); double getPosition(int index); typedef std::vector<double> DoubleVector; typedef std::vector<DoubleVector> DoubleMatrix; DoubleVector audioVector; DoubleMatrix audioMatrix; double screenHeight; int length; double audioScaleSamples; double playPosition;//in samples }; #endif