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   

Travelled to 5 computer(s): bhatertpkbcr, mqqgnosmbjvj, pzhvpgtvlbxg, tvejysmllsmz, 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: 28 / 44
Referenced in: [show references]

Formerly at http://tinybrain.de/1026989 & http://1026989.tinybrain.de