sS vosk_recognize16KWav(File wav, O... _) { optPar bool useKnownPlaces; optPar S envVars; optPar S language = "en"; assertFileExists(wav); File dir = assertNotNull("vosk dir not set", vosk_example_dir()); File model1 = newFile(dir, "model-" + assertIdentifier(language)); assertFileExists(model1); LS args = ll(platformQuote(model1)); File outFile, errFile; if (useKnownPlaces) outFile = javaxCachesDir("vosk.out"); else outFile = createTempFile(); File pyFile = newFile(dir, "recognize.py"); if (!fileExists(pyFile)) saveTextFile(pyFile, loadSnippet(#1026985)); time "vosk recognition" { backtick_verbose("python3 " + platformQuote(pyFile) + " " + + joinWithSpace(args) + " " + platformQuote(wav) + " > " + platformQuote(outFile) + " 2>&1"); } ret trim(loadTextFile(outFile)); } sS vosk_recognize16KWav(S wav) { ret vosk_recognize16KWav(newFile(wav)); }