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

24
LINES

< > BotCompany Repo | #1010315 // Speech Training [just listens]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (8917L/60K).

1  
!7
2  
3  
static JTextArea ta;
4  
static IVar<S> text;
5  
static Class recognizer;
6  
7  
p-subst {
8  
  recognizer = hotwire(#1009816);
9  
  
10  
  text = persistentVar("Text");
11  
  ta = bindTextAreaToVar(text, jwordwraptextarea());
12  
  showFrame(fontSize(20, ta));
13  
  moveCaretToEnd(ta);
14  
15  
  set(recognizer, onUtterance := voidfunc(S utterance) {
16  
    if (match("turn off", utterance))
17  
      call(recognizer, 'stopRecognition);
18  
    appendToTextAreaAndMoveCaret(ta, utterance + "\n");
19  
  });
20  
  
21  
  set(recognizer, startRecognition := true);
22  
  callMain(recognizer);
23  
  call(recognizer, 'botsToSendTo, ll());
24  
}

Author comment

Began life as a copy of #1009884

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1010315
Snippet name: Speech Training [just listens]
Eternal ID of this version: #1010315/10
Text MD5: 23efbeba6aea5c20249ad4ac0effc6d3
Transpilation MD5: e4450065d17e0227a882b5662b3836df
Author: stefan
Category: javax / speech
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-11 20:18:17
Source code size: 594 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 458 / 1158
Version history: 9 change(s)
Referenced in: [show references]