00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00029 #ifndef PITCHMARKS_H
00030 #define PITCHMARKS_H
00031
00032 #include <vector>
00033 #include <map>
00034 #include <iostream>
00035 #include <fstream>
00036 #include "pitchmark_parser.h"
00037
00038 using namespace std;
00039
00043 typedef vector< pair<double, double> > PitchContour;
00044
00045
00049 class Pitchmark {
00050 public:
00051 double time;
00052 bool voiced;
00053 double intensity;
00054 Pitchmark(double _time=0.0, bool _voiced=true): time(_time), voiced(_voiced){}
00055 };
00056
00057
00061 class Pitchmarks: public vector<Pitchmark> {
00062
00063 int getPitchmarkFormat(const string & filename);
00064 void loadPraatPitchmarks(const string & filename, const double start, const double end);
00065 void loadRawPitchmarks(const string & filename, const double start, const double end);
00066 double interpolate(double x, const pair<double,double> & p1, const pair<double,double> & p2);
00067
00068 public:
00069 Pitchmarks(): vector<Pitchmark>(0) {}
00070
00071
00072 Pitchmarks(vector< pair< double, double > >, double duration, double startTime);
00073 void loadPitchmarks(const string & filename, const double start, const double end);
00074 bool selfCheck();
00075
00076 };
00077
00079
00080 #endif
00081