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

14
LINES

< > BotCompany Repo | #1026989 // espeakToWAV [if on path]

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

Libraryless. Click here for Pure Java version (4008L/28K).

static File espeakToWAV(S text, S voice) {
  File wav = prepareCacheProgramFile("Computer Voices/eSpeak/" + uniqueFileNameUsingMD5_80_v2(appendIfNempty(voice, "|") + text) + ".wav");
  if (fileEmptyOrNotThere(wav))
    espeakToWAV(text, voice, wav);
  ret wav;
}
  
static File espeakToWAV(S text, S voice, File wav) {
  backtick("espeak "
    + "-w " + platformQuoteOpt(wav)
    + (nempty(voice) ? "-v " + platformQuoteOpt(voice) : "")
    + platformQuote(text));
  ret wav;
}

Author comment

Began life as a copy of #1024505

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: #1026989
Snippet name: espeakToWAV [if on path]
Eternal ID of this version: #1026989/1
Text MD5: bdee4759ecaa3972e4bd26940a1dcf60
Transpilation MD5: 6ef657b0044975073217c9f8c8974692
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-06 11:52:58
Source code size: 490 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 197 / 244
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)