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

40
LINES

< > BotCompany Repo | #1004759 // cereproc - speak with a Cereproc voice and return mp3. supports gain := ...

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

Uses 885K of libraries. Click here for Pure Java version (7848L/57K).

please include function cereproc_preload.

static int cereproc_maxChars = 1000;

static File cereproc(fS voice, S text, O... _) {
  text = cereproc_preprocess(text);
  if (empty(text)) null;
  
  print("[" + voice + "] " + text);
  
  do {
    sleep(10);
  } while (eq(cereproc_preload_loading, pair(voice, text)));
  
  File file = cereproc_silent_preprocessed(voice, text);
  if (file != null) {
    lock voiceOutputLock();
    logStructureWithDate(cereprocLog(), litorderedmap(action := "Begin talking", +voice, +text));
    fS _text = text;
    
    if (isStefanReichsPC()) {
      Map map = litorderedmap(
        where := "voice",
        type := 'said,
        +voice,
        date := localDateWithMilliseconds(),
        globalID := aGlobalID(),
        +text);
      mechAppendQ_noUniq("Voice I/O Log", struct(map));
    }
    
    optPar IVF1<File> playMP3;
    if (playMP3 != null)
      callF(playMP3, file);
    else
      playMp3(file, _);
    logStructureWithDate(cereprocLog(), litorderedmap(action := "End talking", +voice, +text));
  }
  ret file;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1004759
Snippet name: cereproc - speak with a Cereproc voice and return mp3. supports gain := ...
Eternal ID of this version: #1004759/24
Text MD5: bdb1babb0adf83864a4388d572e32af0
Transpilation MD5: 7f08e1919bde46c9b7486cebdacad7dd
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-07 00:44:15
Source code size: 1108 bytes / 40 lines
Pitched / IR pitched: No / No
Views / Downloads: 746 / 1254
Version history: 23 change(s)
Referenced in: [show references]