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

1  
please include function cereproc_preload.
2  
3  
static int cereproc_maxChars = 1000;
4  
5  
static File cereproc(fS voice, S text, O... _) {
6  
  text = cereproc_preprocess(text);
7  
  if (empty(text)) null;
8  
  
9  
  print("[" + voice + "] " + text);
10  
  
11  
  do {
12  
    sleep(10);
13  
  } while (eq(cereproc_preload_loading, pair(voice, text)));
14  
  
15  
  File file = cereproc_silent_preprocessed(voice, text);
16  
  if (file != null) {
17  
    lock voiceOutputLock();
18  
    logStructureWithDate(cereprocLog(), litorderedmap(action := "Begin talking", +voice, +text));
19  
    fS _text = text;
20  
    
21  
    if (isStefanReichsPC()) {
22  
      Map map = litorderedmap(
23  
        where := "voice",
24  
        type := 'said,
25  
        +voice,
26  
        date := localDateWithMilliseconds(),
27  
        globalID := aGlobalID(),
28  
        +text);
29  
      mechAppendQ_noUniq("Voice I/O Log", struct(map));
30  
    }
31  
    
32  
    optPar IVF1<File> playMP3;
33  
    if (playMP3 != null)
34  
      callF(playMP3, file);
35  
    else
36  
      playMp3(file, _);
37  
    logStructureWithDate(cereprocLog(), litorderedmap(action := "End talking", +voice, +text));
38  
  }
39  
  ret file;
40  
}

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: 828 / 1364
Version history: 23 change(s)
Referenced in: [show references]