chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:45:58 +08:00
commit 2dd9ea9aee
261 changed files with 32719 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env python3
import sys
import json
from vosk import Model, KaldiRecognizer
model = Model(lang="en-us")
# Large vocabulary free form recognition
rec = KaldiRecognizer(model, 16000)
# You can also specify the possible word list
#rec = KaldiRecognizer(model, 16000, "zero oh one two three four five six seven eight nine")
with open(sys.argv[1], "rb") as wf:
wf.read(44) # skip header
while True:
data = wf.read(4000)
if len(data) == 0:
break
if rec.AcceptWaveform(data):
res = json.loads(rec.Result())
print(res["text"])
res = json.loads(rec.FinalResult())
print(res["text"])