Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1026958 // deepspeech - recognize audio file with DeepSpeech (if installed in a certain dir)

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4834L/34K).

// optional parameter: bool useKnownPlaces
sS deepspeech(File audioFile, O... _) {
  if (is16KMonoWAVFile(audioFile))
    // 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");
  deleteFile(wav);
  ffmpeg_toMonoAudio_16k(audioFile, wav);
  ret deepspeech_recognize16KWav(wav, _);
}

sS deepspeech(S f, O... _) {
  ret deepspeech(newFile(f), _);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, snaazhdonpnp, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026958
Snippet name: deepspeech - recognize audio file with DeepSpeech (if installed in a certain dir)
Eternal ID of this version: #1026958/10
Text MD5: a228b6567b73392d4b1f88f7aaad945b
Transpilation MD5: 086b2d51c483f947204ab82e0d429c7f
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-28 13:55:04
Source code size: 626 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 233 / 334
Version history: 9 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1026983 - vosk - recognize audio file with vosk (if installed in a certain dir)