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

48
LINES

< > BotCompany Repo | #1008219 // Get recognized text from phone on same subnet (#1008218)

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

Download Jar. Libraryless. Click here for Pure Java version (6179L/43K).

!7

static int delay = 1000;

static JLabel lblText;
sS phoneIP, lineFromBot;

p {
  makeBot("Forwarded Recognizer.");
  swing {
    setText_opt = false;
    setConsoleWidth(400);
    setConsoleHeight(500);
    consoleFrame().setLocation(100, 100);
    consoleFont(sansSerif(40));
    wordWrapConsole();
    consoleMaxChars(1000);
  }
  while licensed {
    phoneIP = waitForPhone();
    if (phoneIP == null) ret;
    setConsoleTitle(phoneIP);
    S last = "";
    swing {
      manualConsole();
      lblText = jcenteredlabel();
      lblText.setFont(sansSerif(40));
      replaceComponent(consoleTextArea(), lblText);
    }
    repeat with ms sleep delay {
      S s = lineFromBot = sendToPublicCommBot/*Silently*/(phoneIP, forward("Recognizer.", "text"));
      s = substring(s, smartIndexOf(s, ":")+1);
      last = s;
      if (nempty(last)) {
        L<S> tokens = javaTokC(s);
        setText_htmlencode(lblText, joinLines(tokens));
        setConsoleTitle(or2(join(" ", takeLast(2, tokens)), "[Speech]") + " - " + phoneIP);
        awt {
          lblText.scrollRectToVisible(new Rectangle(0, 10000, 1, 1));
        }
      }
    }
  }
}

answer {
  if "text" ret lineFromBot;
}

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: #1008219
Snippet name: Get recognized text from phone on same subnet (#1008218)
Eternal ID of this version: #1008219/48
Text MD5: 853c01ba0ca4ee9fa616e086cccde242
Transpilation MD5: a5f3674c511e4f873b5acc4e5cdf26f4
Author: stefan
Category: javax / speech recognition
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-03 14:30:18
Source code size: 1233 bytes / 48 lines
Pitched / IR pitched: No / No
Views / Downloads: 661 / 1609
Version history: 47 change(s)
Referenced in: