k2-fsa / sherpa-ncnn

Real-time speech recognition and voice activity detection (VAD) using next-gen Kaldi with ncnn without Internet connection. Support iOS, Android, Linux, macOS, Windows, Raspberry Pi, VisionFive2, LicheePi4A etc.
https://k2-fsa.github.io/sherpa/ncnn/index.html
Apache License 2.0
996 stars 154 forks source link

ios bug #277

Closed HalFTeen closed 11 months ago

HalFTeen commented 11 months ago

Android has fixed the bug by #265 , while the bug is still alive in ios. it seems not restart the model or something after decoding one wave.

HalFTeen commented 11 months ago

when decoding a wav list, each decoding result after the second wav will have the last character. for example: wavlist: 1.wav 1.wav 1.wav, decodeing results: 1.wav 今天天气很好 1.wav 好今天天气很好 1.wav 好今天天气很好 Invoking CreatStream() before decode one wav can solve this problem. Note: invoking Reset() is useless because https://github.com/k2-fsa/sherpa-ncnn/blob/61664c7bd2a8afe2622fc101bba06a3667fb60ee/sherpa-ncnn/csrc/recognizer.cc#L222 (I doubt that). BTW, the overhead of CreatStream() is little. so you can do that.