Add iOS support (#65)

This commit is contained in:
Fangjun Kuang
2023-02-25 21:56:25 +08:00
committed by GitHub
parent fb1e24bebb
commit 475caf22f9
34 changed files with 2669 additions and 23 deletions

View File

@@ -160,14 +160,17 @@ class OnlineRecognizer::Impl {
}
void Reset(OnlineStream *s) const {
// reset result and neural network model state,
// but keep the feature extractor state
// reset result, neural network model state, and
// the feature extractor state
// reset result
s->SetResult(decoder_->GetEmptyResult());
// reset neural network model state
s->SetStates(model_->GetEncoderInitStates());
// reset feature extractor
s->Reset();
}
private:

View File

@@ -32,7 +32,10 @@ class OnlineStream::Impl {
return feat_extractor_.GetFrames(frame_index, n);
}
void Reset() { feat_extractor_.Reset(); }
void Reset() {
feat_extractor_.Reset();
num_processed_frames_ = 0;
}
int32_t &GetNumProcessedFrames() { return num_processed_frames_; }