4

I have a Delphi 6 app that embeds the Chromium web browser. I want to click the Chrome microphone button (speech input control) from Javascript. I tried the usual method of calling the button's click() handler, but nothing happened. Below is the HTML I tried with the first input element being the Chrome speech input control and the second input element being a checkbox that when checked, finds the speech input control and calls its click() handler:

<input name="speechInput1" id="speechInput1" size=64 type="text" x-webkit-speech />
<input type="checkbox" onClick="document.getElementById('speechInput1').click();">Check the box to simulate a button click

Is there a way to click the speech input controls microphone button from Javascript? I found another post on Stack Overflow similar to my question but there were no solutions:

Automate speech input recording in Chrome

If not, is there a way to determine from my Delphi 6 app the location of the button in Windows screen coordinates so I can move the mouse over it and click it?

I know about AutoIt from this Stack Overflow post:

Send click to google's chrome input html tag

But I want to handle the mouse click myself instead of asking my users to download and set up AutoIt.

I also want to ask if anybody knows if it is possible to call the services made available to Chrome extensions via Javascript. If that were possible, I could call the startSpeechInput() method the speech input control exposes to extensions.

Community
  • 1
  • 1
Robert Oschler
  • 13,520
  • 17
  • 74
  • 209

1 Answers1

3

The Chromium Embedded webkit Speech Input support is disabled at this time due to this issue. You can verify the Speech Input support by navigating to this site:

http://blogs.sitepointstatic.com/examples/tech/speech-input/index.html

I got the folowing result with this version of Chromium (the most recent at this time):

enter image description here

TLama
  • 71,521
  • 15
  • 192
  • 348
  • 1
    Thanks for finding that. I get an access violation in libcef.dll when I navigate to a web page with the speech input control and click on the mic button. I thought it was just a problem with my code that I could fix but I guess not. That's a shame. – Robert Oschler May 19 '12 at 14:48
  • 1
    So then you most probably hit that issue with an older version of Chromium. In the most recent version is the Speech Input just disabled and who knows when will be implemented. – TLama May 19 '12 at 15:04
  • 1
    You're right. I have an older version of TChromium before they disabled the speech input buttons and therefore I get an access violation instead. I'll just avoid web pages with speech input buttons since I can't upgrade my TChromium version. The newer versions aren't compatible with Delphi 6. Thanks. – Robert Oschler Jun 05 '12 at 11:51