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

39
LINES

< > BotCompany Repo | #1016940 // Voice Output v1 [Just the voice output dialog, Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 206K of libraries. Click here for Pure Java version (15785L/113K).

1  
!7
2  
3  
sclass VoiceOutput > DynTextArea {
4  
  S voice;
5  
  
6  
  void start {
7  
    if (empty(voice))
8  
      setField(voice := first(cereprocVoices()));
9  
  }
10  
  
11  
  JComponent visualize() {
12  
    bindComboBoxToLiveValue_debug.set(true);
13  
    JComponent c = super.visualize();
14  
    enableWordWrapForTextArea(textArea);
15  
    jPreemptEnterKey(textArea, rThread sayIt);
16  
    ret centerAndSouthWithMargins(c,
17  
      centerAndEastWithMarginInbetween(withLabel("Voice:", jLiveValueComboBox(cereprocVoices(), dm_fieldLiveValue('voice))),
18  
        jbutton("Say", rThread sayIt)));
19  
  }
20  
  
21  
  void say(S s) {
22  
    {
23  
      temp enter();
24  
      setText(s);
25  
    }
26  
    sayIt();
27  
  }
28  
  
29  
  void sayIt {
30  
    S s = trim(getText());
31  
    if (empty(s) || empty(voice)) ret;
32  
    if (isCereprocVoice(voice))
33  
      cereproc(voice, s);
34  
    else
35  
      print("Missing voice: " + voice);
36  
  }
37  
38  
  void clear() { setText(""); }
39  
}

Author comment

Began life as a copy of #1016614

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016940
Snippet name: Voice Output v1 [Just the voice output dialog, Dyn Module]
Eternal ID of this version: #1016940/2
Text MD5: 80740d648e186c91f9bab9251c9e21bf
Transpilation MD5: 2222fa0480ec8fe5f892e290a72bd1e3
Author: stefan
Category: javax / dynamic modules
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-09 13:01:47
Source code size: 909 bytes / 39 lines
Pitched / IR pitched: No / No
Views / Downloads: 341 / 438
Version history: 1 change(s)
Referenced in: [show references]