21 #ifndef KALDI_ONLINE2_ONLINE_SPEEX_WRAPPER_H_ 22 #define KALDI_ONLINE2_ONLINE_SPEEX_WRAPPER_H_ 25 #include <speex/speex.h> 61 speex_bits_frame_size(106),
62 speex_wave_frame_size(320) { }
65 opts->
Register(
"sample-rate", &sample_rate,
"Sample frequency of the waveform.");
66 opts->
Register(
"speex-quality", &speex_quality,
"Speex speech quality.");
67 opts->
Register(
"speex-bits-frame-size", &speex_bits_frame_size,
68 "#bytes of each Speex compressed frame.");
69 opts->
Register(
"speex-wave-frame-size", &speex_wave_frame_size,
70 "#samples of each waveform frame.");
85 *spx_bits = speex_encoded_char_bits_;
86 speex_encoded_char_bits_.clear();
107 std::vector<char> *speex_encoder_bits) ;
115 void AcceptSpeexBits(
const std::vector<char> &spx_enc_bits);
118 *waveform = waveform_;
134 void Decode(
const std::vector<char> &speex_char_bits,
140 #endif // KALDI_ONLINE2_ONLINE_SPEEX_WRAPPER_H_ This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void GetWaveform(Vector< BaseFloat > *waveform)
std::vector< char > speex_encoded_char_bits_
Vector< BaseFloat > waveform_remainder_
Vector< BaseFloat > waveform_
void Resize(MatrixIndexT length, MatrixResizeType resize_type=kSetZero)
Set vector to a specified size (can be zero).
int32 speex_decoded_frame_size_
virtual void Register(const std::string &name, bool *ptr, const std::string &doc)=0
int32 speex_wave_frame_size
In samples.
std::vector< char > speex_bits_remainder_
int32 speex_encoded_frame_size_
BaseFloat sample_rate
The sample frequency of the waveform, it decides which Speex mode to use.
A class representing a vector.
void Register(OptionsItf *opts)
int32 speex_quality
Ranges from 0 to 10, the higher the quality is better.
Provides a vector abstraction class.
void GetSpeexBits(std::vector< char > *spx_bits)
int32 speex_bits_frame_size
In bytes.