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"); errFile = javaxCachesDir("vosk.err"); } else { outFile = createTempFile(); errFile = createTempFile(); } time "vosk recognition" { backtick_verbose("python3 " + platformQuote(newFile(dir, "recognize.py")) + " " + + joinWithSpace(args) + " " + platformQuote(wav) + " > " + platformQuote(outFile) + " 2> " + platformQuote(errFile)); } ret trim(loadTextFile(outFile)); } sS vosk_recognize16KWav(S wav) { ret vosk_recognize16KWav(newFile(wav)); }