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

27
LINES

< > BotCompany Repo | #1009224 // Chrome Spracherkennungstest [WORKS]

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

Libraryless. Click here for Pure Java version (3333L/25K/68K).

1  
!7
2  
3  
p {
4  
  if (isMainProgram()) serveHttpAndOpenBrowser();
5  
}
6  
7  
html {
8  
  ret h3("Chrome Spracherkennungstest")
9  
    + loadJQuery()
10  
    + hdiv("Ergebnisse erscheinen hier", id := 'results, style := "margin: 10px")
11  
  + hjavascript([[
12  
    try {
13  
      var recognition = new webkitSpeechRecognition();
14  
      recognition.lang = "de-DE";
15  
      recognition.onresult = function(event) { 
16  
        var result = event.results[0];
17  
        var transcript = result[0].transcript;
18  
        $("#results").html("Transcript: " + transcript);
19  
      }
20  
      $("#results").html("Bereit");
21  
      //recognition.start();
22  
    } catch (err) {
23  
      $("#results").html("Falscher Browser");
24  
    }
25  
  ]])
26  
    + tag('button, "Starte Erkennung", onclick := "recognition.start()", type := 'button);
27  
}

Author comment

Began life as a copy of #1009223

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: #1009224
Snippet name: Chrome Spracherkennungstest [WORKS]
Eternal ID of this version: #1009224/4
Text MD5: 8617d00dbba3ce86a54c6fc629d63d8b
Transpilation MD5: 605f30acd7bd699972307a5934cbf6e6
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-20 17:29:24
Source code size: 787 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 446 / 4019
Version history: 3 change(s)
Referenced in: [show references]