So I was just playing around and right clicked on the mic that appears on the Google Search bar and selected "inspect element", which I'm sure most of you know brings up the code for that particular element. I was digging around in VoxCommando to see if I can somehow select that mic via my voice and perform a Goggle voice search that way. I'd dig around more but my brain seems to have hit a wall and I'm trying to figure this out after a long day of bartending. Definitely going to look into it in the morning with a clear head, but thought maybe I would ask here for any thoughts.
You can do a Google search or lucky search using VC and get the same search results.
If it's very important to you to use Google voice recognition instead of VoxCommando's speech recognition, under certain circumstances this is also possible.
see jitterjames's post and the follow-up post
http://voxcommando.com/forum/index.php?topic=2053.msg17805#msg17805
Well, I couldn't exactly get it to work with the xml that was provided in that thread. But I did figure out how to make it work with a simulated mouse press. I found that I can input x,y coordinates for the mouse and simulate a left click. So I just automated the mouse cursor to click the Ok Google mic. I wanted to figure this out because Google Voice searches seem to be more reliable than the MS voice recognition software. For example, if I say "Google search Stargate," MS comes up with some other weird word. But if I use Google voice search it picks it up perfectly. Google just seems to be much more reliable.
I think now I want to figure out how I can select a search result via voice.
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<command id="248" name="Google Ok Google" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Launch.OpenURL</cmdType>
<params>
<param>http://google.com/search?sourceid=navclient&q=</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.Pause</cmdType>
<params>
<param>3000</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Sound.PlayWav</cmdType>
<params>
<param>C:\Users\Ricky\Desktop\clicking.wav</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Mouse.MoveAbsolute</cmdType>
<params>
<param>1230,410</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Mouse.LeftClick</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.Pause</cmdType>
<params>
<param>5000</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Google search</phrase>
</command>
That's awesome, thanks for this awesome topic guys
@Ricky ... how about launching it in RoboB ... then you can generate voice feedback and let the user to choose the result by voice !!
oops ...never mind ... Just realised that "ok google" works only in chrome
Good idea, never really used google voice search but it does work well.
Couple of questions, is there a way to get VC to pause until google has loaded, problem is sometimes this is one second, some times 10 seconds. I can't put in the left click until the microphone icon is visible?www.google.co.uk
The other question is my mouse co-ordinates don't always go to where they should, but sometimes they do. Maybe a topic for another topic but thought I'd mention.
Actually there is a hotkey of Ctrl + Shift + . (period) that will start voice search when your on the google page. Only problem is I don't know how we send . (period) into VC but it's a better option as web pages change design & the mic icon will no doubt be put somewhere else at some point.
Quote from: SteveB69 on January 08, 2016, 11:17:09 PM
Actually there is a hotkey of Ctrl + Shift + . (period) that will start voice search when your on the google page. Only problem is I don't know how we send . (period) into VC
If you are using InputKeys.Send it is OEM_PERIOD
So the correct parameter to pass for that key combination would be:
{SHIFT+CONTROL}({OEM_PERIOD})Using the keyboard you will still have to wait until the page loads. I don't think there is any way to know when it has loaded though so to be safe you would need to find the longest time possible and use that. So 10 seconds for you.