8 * Created by Mark Levy on 23/03/2006.
9 * Copyright 2006 Centre for Digital Music, Queen Mary, University of London.
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2 of the
14 License, or (at your option) any later version. See the file
15 COPYING included with this distribution for more information.
28 int start; // in samples
36 int nsegtypes; // number of segment types, so possible types are {0,1,...,nsegtypes-1}
38 vector<Segment> segments;
41 ostream& operator<<(ostream& os, const Segmentation& s);
47 virtual ~Segmenter() {}
48 virtual void initialise(int samplerate) = 0; // must be called before any other methods
49 virtual int getWindowsize() = 0; // required window size for calls to extractFeatures()
50 virtual int getHopsize() = 0; // required hop size for calls to extractFeatures()
51 virtual void extractFeatures(const double* samples, int nsamples) = 0;
52 virtual void segment() = 0; // call once all the features have been extracted
53 virtual void segment(int m) = 0; // specify desired number of segment-types
54 virtual void clear() { features.clear(); }
55 const Segmentation& getSegmentation() const { return segmentation; }
57 vector<vector<double> > features;
58 Segmentation segmentation;