Transpiled version (4804L) is out of date.
1 | // optional parameter: bool useKnownPlaces |
2 | sS vosk(File audioFile, O... _) { |
3 | if (isRIFFFileByContent(audioFile) && |
4 | eq(wavSampleRateAndChannels(audioFile), pair(16000f, 1))) |
5 | // assuming 16 bit |
6 | ret vosk_recognize16KWav(audioFile, _); |
7 | |
8 | optPar bool useKnownPlaces; |
9 | File wav = useKnownPlaces ? javaxCachesDir("16k-for-vosk.wav") : createTempFileWithExtension(".wav"); |
10 | temp useKnownPlaces ? null : tempDeleteFile(wav); |
11 | print("Converting " + audioFile + " to 16k WAV"); |
12 | deleteFile(wav); |
13 | ffmpeg_toMonoAudio_16k(audioFile, wav); |
14 | ret vosk_recognize16KWav(wav, _); |
15 | } |
16 | |
17 | sS vosk(S f, O... _) { |
18 | ret vosk(newFile(f), _); |
19 | } |
Began life as a copy of #1026958
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1026983 |
Snippet name: | vosk - recognize audio file with vosk (if installed in a certain dir) |
Eternal ID of this version: | #1026983/3 |
Text MD5: | aa5737cbb3ac576eb8999018907641f8 |
Author: | stefan |
Category: | javax / speech recognition |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-02-05 23:25:43 |
Source code size: | 658 bytes / 19 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 293 / 365 |
Version history: | 2 change(s) |
Referenced in: | [show references] |