!752 static S rawLink(S pageName) { ret "/" + parseSnippetID(getProgramID()) + "/raw/" + pageName; } static S html(S uri, Map params) { if (eq(uri, "/has-speech")) { S s = params.get("q"); S text = s; /* ((ThreadLocal) get(getMainBot(), "attn")).set(true); pivoMode. set(true); S text = //askSelf(s); callStaticAnswerMethod(mc(), s); if (empty(text)) ret ""; S soundURL = getSoundURLCereproc(text, voice); S html = [[ ]]; html = html.replace("SRC", htmlencode(soundURL)); */ ret "Speech: " + htmlencode(text) /* + "
" + html*/; } if (eq(uri, "/empty")) { ret ""; } if (eq(uri, "/upper")) { S html = [=[ TinyBrain Speech Demo

Click on the microphone icon and begin speaking.

Speak after the bleep.

No speech was detected

Click the "Allow" button.

Permission to use microphone was denied.

Permission to use microphone is blocked. To change, go to chrome://settings/contentExceptions#media-stream

Web Speech API is not supported by this browser. Upgrade to Chrome version 25 or later.

     
]=]; ret render(html); } // frame set ret render([[ Pivo 2 Continuous ]]); } static S render(S html) { ret html.replace("LINK/", rawLink("")); }