// optional parameter: bool useKnownPlaces sS deepspeech(File audioFile, O... _) { if (isRIFFFileByContent(audioFile) && eq(wavSampleRateAndChannels(audioFile), pair(16000f, 1))) // assuming 16 bit ret deepspeech_recognize16KWav(audioFile, _); optPar bool useKnownPlaces; File wav = useKnownPlaces ? javaxCachesDir("16k-for-deepspeech.wav") : createTempFileWithExtension(".wav"); temp useKnownPlaces ? null : tempDeleteFile(wav); print("Converting " + audioFile + " to 16k WAV"); ffmpeg_toMonoAudio_16k(audioFile, wav); ret deepspeech_recognize16KWav(wav, _); } sS deepspeech(S f, _) { ret deepspeech(newFile(f), _); }