From 83346ca27d5f8f2a8086db168301b1f6ca9c1ffd Mon Sep 17 00:00:00 2001 From: wnma Date: Fri, 25 Feb 2022 21:55:45 +0800 Subject: [PATCH] add SetWords In the lastest vosk-api version, the api haved changed. See https://github.com/alphacep/vosk-api/blob/ad546a8f1a915ee166407e8d82c8cd2cc9cb8ec0/python/example/test_simple.py#L21 --- pinyin_timestamping.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pinyin_timestamping.py b/pinyin_timestamping.py index 95848b32..4e0daf8f 100755 --- a/pinyin_timestamping.py +++ b/pinyin_timestamping.py @@ -71,6 +71,7 @@ def digi_to_py(word): model = Model("model") rec = KaldiRecognizer(model, wf.getframerate()) +rec.SetWords(True) while True: data = wf.readframes(1000000)