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).

1  
// optional parameter: bool useKnownPlaces
2  
sS deepspeech(File audioFile, O... _) {
3  
  if (is16KMonoWAVFile(audioFile))
4  
    // assuming 16 bit
5  
    ret deepspeech_recognize16KWav(audioFile, _);
6  
    
7  
  optPar bool useKnownPlaces;
8  
  File wav = useKnownPlaces ? javaxCachesDir("16k-for-deepspeech.wav") : createTempFileWithExtension(".wav");
9  
  temp useKnownPlaces ? null : tempDeleteFile(wav);
10  
  print("Converting " + audioFile + " to 16k WAV");
11  
  deleteFile(wav);
12  
  ffmpeg_toMonoAudio_16k(audioFile, wav);
13  
  ret deepspeech_recognize16KWav(wav, _);
14  
}
15  
16  
sS deepspeech(S f, O... _) {
17  
  ret deepspeech(newFile(f), _);
18  
}

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: 234 / 335
Version history: 9 change(s)
Referenced in: [show references]