#include <FeatureFileReader.h>


Public Member Functions | |
| FeatureFileReader (const Config &c) | |
| FeatureFileReader (const FileName &f, const Config &c, LabelServer *ls=NULL, BigEndian be=BIGENDIAN_AUTO, BufferUsage=BUFFER_AUTO, unsigned long bufferSize=0, HistoricUsage=ALL_FEATURES, unsigned long historicSize=0) | |
| FeatureFileReader (const XLine &l, const Config &, LabelServer *ls=NULL, BigEndian be=BIGENDIAN_AUTO, BufferUsage=BUFFER_AUTO, unsigned long bufferSize=0, HistoricUsage=ALL_FEATURES, unsigned long historicSize=0) | |
| virtual | ~FeatureFileReader () |
| virtual void | seekFeature (unsigned long featureNbr, const String &srcName="") |
| virtual bool | readFeature (Feature &f, unsigned long s=1) |
| virtual bool | writeFeature (const Feature &f, unsigned long step=1) |
| virtual unsigned long | getFeatureCount () |
| virtual unsigned long | getVectSize () |
| virtual const FeatureFlags & | getFeatureFlags () |
| virtual real_t | getSampleRate () |
| virtual unsigned long | getSourceCount () |
| virtual unsigned long | getFeatureCountOfASource (unsigned long srcIdx) |
| virtual unsigned long | getFeatureCountOfASource (const String &src) |
| virtual unsigned long | getFirstFeatureIndexOfASource (unsigned long srcIdx) |
| virtual unsigned long | getFirstFeatureIndexOfASource (const String &srcName) |
| virtual const String & | getNameOfASource (unsigned long srcIdx) |
| virtual void | close () |
| virtual void | setExternalBufferToUse (FloatVector &v) |
| virtual String | getClassName () const |
Static Public Member Functions | |
| static FeatureFileReader & | create (const Config &c) |
| static FeatureFileReader & | create (const FileName &f, const Config &c, LabelServer *ls=NULL, BigEndian be=BIGENDIAN_AUTO, BufferUsage=BUFFER_AUTO, unsigned long bufferSize=0, HistoricUsage=ALL_FEATURES, unsigned long historicSize=0) |
| static FeatureFileReader & | create (const XLine &l, const Config &c, LabelServer *ls=NULL, BigEndian be=BIGENDIAN_AUTO, BufferUsage=BUFFER_AUTO, unsigned long bufferSize=0, HistoricUsage=ALL_FEATURES, unsigned long historicSize=0) |
| static FeatureFileReaderAbstract & | createStream (const Config &c) |
| static FeatureFileReaderAbstract & | createStream (const FileName &f, const Config &c, LabelServer *ls, BigEndian be, BufferUsage b, unsigned long bufferSize, HistoricUsage, unsigned long historicSize) |
| static FeatureFileReaderAbstract & | createStream (const XLine &l, const Config &c, LabelServer *p, BigEndian be, BufferUsage b, unsigned long bufferSize, HistoricUsage, unsigned long historicSize) |
Private Member Functions | |
| bool | operator== (const FeatureFileReader &) const |
| bool | operator!= (const FeatureFileReader &) const |
| const FeatureFileReader & | operator= (const FeatureFileReader &) |
| FeatureFileReader (const FeatureFileReader &) | |
Private Attributes | |
| FeatureFileReaderAbstract * | _pFeatureReader |
Friends | |
| class | TestFeatureFileReader |
Convenient class for reading features from files with various formats (HTK, SPRO3/4, RAW)
Definition at line 84 of file FeatureFileReader.h.
| alize::FeatureFileReader::FeatureFileReader | ( | const Config & | c ) |
Creates a reader for an empty file.
| c | the configuration to use |
| alize::FeatureFileReader::FeatureFileReader | ( | const FileName & | f, |
| const Config & | c, | ||
| LabelServer * | ls = NULL, |
||
| BigEndian | be = BIGENDIAN_AUTO, |
||
| BufferUsage | = BUFFER_AUTO, |
||
| unsigned long | bufferSize = 0, |
||
| HistoricUsage | = ALL_FEATURES, |
||
| unsigned long | historicSize = 0 |
||
| ) |
Creates a reader for a feature file.
| f | a file to read. No path is required. It uses the parameter "featureFilesPath" of the configuration. |
| c | the configuration to use |
| ls | address of a label server. can be NULL. |
| be | big endian ? Can be BIGENDIAN_AUTO, BIGENDIAN_TRUE or BIGENDIAN_FALSE |
| alize::FeatureFileReader::FeatureFileReader | ( | const XLine & | l, |
| const Config & | , | ||
| LabelServer * | ls = NULL, |
||
| BigEndian | be = BIGENDIAN_AUTO, |
||
| BufferUsage | = BUFFER_AUTO, |
||
| unsigned long | bufferSize = 0, |
||
| HistoricUsage | = ALL_FEATURES, |
||
| unsigned long | historicSize = 0 |
||
| ) | [explicit] |
Create a new file reader to read features from a list of file
The files will be opened, read and closed one after the other. The order will be the same as the list order. For the user, it will be as if it was a single file.
| l | list of file to read |
| ls | address of a label server. can be NULL. |
| c | configuration to use |
| be | big endian ? Can be BIGENDIAN_AUTO, BIGENDIAN_TRUE or BIGENDIAN_FALSE |
| virtual alize::FeatureFileReader::~FeatureFileReader | ( | ) | [virtual] |
| alize::FeatureFileReader::FeatureFileReader | ( | const FeatureFileReader & | ) | [private] |
Not implemented
| virtual void alize::FeatureFileReader::close | ( | ) | [virtual] |
Closes all opened files
Implements alize::FeatureInputStream.
| static FeatureFileReader& alize::FeatureFileReader::create | ( | const Config & | c ) | [static] |
See constructor with same parameters
| static FeatureFileReader& alize::FeatureFileReader::create | ( | const FileName & | f, |
| const Config & | c, | ||
| LabelServer * | ls = NULL, |
||
| BigEndian | be = BIGENDIAN_AUTO, |
||
| BufferUsage | = BUFFER_AUTO, |
||
| unsigned long | bufferSize = 0, |
||
| HistoricUsage | = ALL_FEATURES, |
||
| unsigned long | historicSize = 0 |
||
| ) | [static] |
See constructor with same parameters
| static FeatureFileReader& alize::FeatureFileReader::create | ( | const XLine & | l, |
| const Config & | c, | ||
| LabelServer * | ls = NULL, |
||
| BigEndian | be = BIGENDIAN_AUTO, |
||
| BufferUsage | = BUFFER_AUTO, |
||
| unsigned long | bufferSize = 0, |
||
| HistoricUsage | = ALL_FEATURES, |
||
| unsigned long | historicSize = 0 |
||
| ) | [static] |
See constructor with same parameters
| static FeatureFileReaderAbstract& alize::FeatureFileReader::createStream | ( | const Config & | c ) | [static] |
| static FeatureFileReaderAbstract& alize::FeatureFileReader::createStream | ( | const FileName & | f, |
| const Config & | c, | ||
| LabelServer * | ls, | ||
| BigEndian | be, | ||
| BufferUsage | b, | ||
| unsigned long | bufferSize, | ||
| HistoricUsage | , | ||
| unsigned long | historicSize | ||
| ) | [static] |
| static FeatureFileReaderAbstract& alize::FeatureFileReader::createStream | ( | const XLine & | l, |
| const Config & | c, | ||
| LabelServer * | p, | ||
| BigEndian | be, | ||
| BufferUsage | b, | ||
| unsigned long | bufferSize, | ||
| HistoricUsage | , | ||
| unsigned long | historicSize | ||
| ) | [static] |
| virtual String alize::FeatureFileReader::getClassName | ( | ) | const [virtual] |
Returns the name of the class
Implements alize::FeatureInputStream.
| virtual unsigned long alize::FeatureFileReader::getFeatureCount | ( | ) | [virtual] |
Returns the number of features in the file
| Exception | if vectSize is 0 |
| IOException | if an I/O error occurs |
Implements alize::FeatureInputStream.
Referenced by alize::FeatureFileList::getFeatureCount().
| virtual unsigned long alize::FeatureFileReader::getFeatureCountOfASource | ( | unsigned long | srcIdx ) | [virtual] |
Returns the feature count of a feature file
| srcIdx | index of the file |
Implements alize::FeatureInputStream.
| virtual unsigned long alize::FeatureFileReader::getFeatureCountOfASource | ( | const String & | src ) | [virtual] |
Returns the feature count of a feature file
| src | name of the file |
Implements alize::FeatureInputStream.
| virtual const FeatureFlags& alize::FeatureFileReader::getFeatureFlags | ( | ) | [virtual] |
Returns the feature flags of this stream.
| IOException | if an I/O error occurs |
| FileNotFoundException |
Implements alize::FeatureInputStream.
| virtual unsigned long alize::FeatureFileReader::getFirstFeatureIndexOfASource | ( | unsigned long | srcIdx ) | [virtual] |
Returns the number of the first feature of a feature file. Useful for a multiple file stream.
| srcIdx | index of the file |
Implements alize::FeatureInputStream.
| virtual unsigned long alize::FeatureFileReader::getFirstFeatureIndexOfASource | ( | const String & | srcName ) | [virtual] |
Returns the number of the first feature of a feature file. Useful for a multiple file stream.
| src | name of the file |
Implements alize::FeatureInputStream.
| virtual const String& alize::FeatureFileReader::getNameOfASource | ( | unsigned long | srcIdx ) | [virtual] |
Returns the a particular feature file. Useful for a multiple file stream.
| srcIdx | index of the file |
Implements alize::FeatureInputStream.
| virtual real_t alize::FeatureFileReader::getSampleRate | ( | ) | [virtual] |
Returns the sample rate of this stream.
| IOException | if an I/O error occurs |
| FileNotFoundException |
Implements alize::FeatureInputStream.
| virtual unsigned long alize::FeatureFileReader::getSourceCount | ( | ) | [virtual] |
Returns the number of files read by the reader
Implements alize::FeatureInputStream.
| virtual unsigned long alize::FeatureFileReader::getVectSize | ( | ) | [virtual] |
Returns the size of the vector inside each feature of the stream.
| IOException | if an I/O error occurs |
| FileNotFoundException |
Implements alize::FeatureInputStream.
| bool alize::FeatureFileReader::operator!= | ( | const FeatureFileReader & | ) | const [private] |
Not implemented
| const FeatureFileReader& alize::FeatureFileReader::operator= | ( | const FeatureFileReader & | ) | [private] |
Not implemented
| bool alize::FeatureFileReader::operator== | ( | const FeatureFileReader & | ) | const [private] |
| virtual bool alize::FeatureFileReader::readFeature | ( | Feature & | f, |
| unsigned long | s = 1 |
||
| ) | [virtual] |
Reads a feature in the stream and move the pointer s step forward
| f | the feature to store the data read |
| s | step (default value = 1) |
| IOException | if an I/O error occurs |
Implements alize::FeatureInputStream.
| virtual void alize::FeatureFileReader::seekFeature | ( | unsigned long | pos, |
| const String & | srcName = "" |
||
| ) | [virtual] |
Sets the position indicator associated with the stream to a new position. Does not throw any exception or error.
| pos | new position of the indicator |
| srcName | source name to seek in a particular source |
Reimplemented from alize::FeatureFileReaderAbstract.
| virtual void alize::FeatureFileReader::setExternalBufferToUse | ( | FloatVector & | v ) | [virtual] |
Connects an external buffer to the reader. This buffer will replace the internal buffer.
| v | the vector |
Reimplemented from alize::FeatureFileReaderAbstract.
| virtual bool alize::FeatureFileReader::writeFeature | ( | const Feature & | f, |
| unsigned long | s = 1 |
||
| ) | [virtual] |
Writes a feature in the stream and move the pointer s step forward
| f | the feature to store the data read |
| s | step (default value = 1) |
| IOException | if an I/O error occurs |
Reimplemented from alize::FeatureInputStream.
friend class TestFeatureFileReader [friend] |
Definition at line 88 of file FeatureFileReader.h.
Definition at line 243 of file FeatureFileReader.h.
1.7.2