This class's purpose is to read in Wave files. More...
#include <wave-reader.h>
Public Member Functions | |
WaveData (BaseFloat samp_freq, const MatrixBase< BaseFloat > &data) | |
WaveData () | |
void | Read (std::istream &is) |
Read() will throw on error. More... | |
void | Write (std::ostream &os) const |
Write() will throw on error. os should be opened in binary mode. More... | |
const Matrix< BaseFloat > & | Data () const |
BaseFloat | SampFreq () const |
BaseFloat | Duration () const |
void | CopyFrom (const WaveData &other) |
void | Clear () |
void | Swap (WaveData *other) |
Private Attributes | |
Matrix< BaseFloat > | data_ |
BaseFloat | samp_freq_ |
Static Private Attributes | |
static const uint32 | kBlockSize = 1024 * 1024 |
This class's purpose is to read in Wave files.
Definition at line 106 of file wave-reader.h.
|
inline |
Definition at line 108 of file wave-reader.h.
|
inline |
|
inline |
Definition at line 136 of file wave-reader.h.
References data_, and WaveInfo::samp_freq_.
|
inline |
Definition at line 131 of file wave-reader.h.
References data_, WaveData::data_, WaveInfo::samp_freq_, and WaveData::samp_freq_.
Definition at line 124 of file wave-reader.h.
References data_.
Referenced by main(), kaldi::TestOnlineAppendFeature(), kaldi::TestOnlineMfcc(), kaldi::TestOnlinePlp(), kaldi::TestOnlineTransform(), UnitTestEndless1(), UnitTestEndless2(), UnitTestHTKCompare1(), UnitTestHTKCompare2(), UnitTestHTKCompare3(), UnitTestHTKCompare4(), UnitTestHTKCompare5(), UnitTestHTKCompare6(), UnitTestMono22K(), UnitTestReadWave(), kaldi::UnitTestSnipEdges(), and UnitTestStereo8K().
|
inline |
Definition at line 129 of file wave-reader.h.
References data_, and WaveInfo::samp_freq_.
Referenced by main(), UnitTestMono22K(), and UnitTestStereo8K().
void Read | ( | std::istream & | is | ) |
Read() will throw on error.
It's valid to call Read() more than once– in this case it will destroy what was there before. "is" should be opened in binary mode.
Definition at line 272 of file wave-reader.cc.
References WaveInfo::BlockAlign(), data_, WaveInfo::DataBytes(), rnnlm::i, WaveInfo::IsStreamed(), rnnlm::j, KALDI_ERR, KALDI_SWAP2, KALDI_WARN, WaveInfo::NumChannels(), WaveInfo::Read(), WaveInfo::ReverseBytes(), and WaveInfo::SampFreq().
Referenced by main(), kaldi::TestOnlineAppendFeature(), kaldi::TestOnlineMfcc(), kaldi::TestOnlinePlp(), kaldi::TestOnlineTransform(), kaldi::UnitTestDiffSampleRate(), UnitTestEndless1(), UnitTestEndless2(), UnitTestHTKCompare1(), UnitTestHTKCompare2(), UnitTestHTKCompare3(), UnitTestHTKCompare4(), UnitTestHTKCompare5(), UnitTestHTKCompare6(), kaldi::UnitTestKeele(), kaldi::UnitTestKeeleNccfBallast(), UnitTestMono22K(), kaldi::UnitTestPenaltyFactor(), kaldi::UnitTestPitchExtractionSpeed(), kaldi::UnitTestPitchExtractorCompareKeele(), kaldi::UnitTestProcess(), UnitTestReadWave(), kaldi::UnitTestSnipEdges(), and UnitTestStereo8K().
|
inline |
Definition at line 126 of file wave-reader.h.
References WaveInfo::samp_freq_.
Referenced by main(), kaldi::TestOnlineAppendFeature(), kaldi::TestOnlineMfcc(), kaldi::TestOnlinePlp(), kaldi::TestOnlineTransform(), UnitTestMono22K(), kaldi::UnitTestSnipEdges(), and UnitTestStereo8K().
|
inline |
Definition at line 141 of file wave-reader.h.
References data_, WaveData::data_, WaveInfo::samp_freq_, WaveData::samp_freq_, and kaldi::swap().
void Write | ( | std::ostream & | os | ) | const |
Write() will throw on error. os should be opened in binary mode.
Definition at line 332 of file wave-reader.cc.
References data_, rnnlm::i, rnnlm::j, KALDI_ASSERT, KALDI_ERR, KALDI_SWAP2, KALDI_WARN, kaldi::WriteUint16(), and kaldi::WriteUint32().
Referenced by main(), and WaveHolder::Write().
Definition at line 148 of file wave-reader.h.
Referenced by WaveData::CopyFrom(), and WaveData::Swap().
|
staticprivate |
Definition at line 147 of file wave-reader.h.
|
private |
Definition at line 149 of file wave-reader.h.
Referenced by WaveData::CopyFrom(), and WaveData::Swap().