Voice to text control

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
StanDouglas
Posts: 2
Joined: 11 Feb 2023, 13:21

Voice to text control

28 Feb 2023, 14:35

I have a script that controls and app using voice commands. i used the tutorial at https://www.the-automator.com/voice-recognition-with-autohotkey/ to get it working
What I'd like to do is output the voice text that is not in my object list to a "chat box" so that I can dictate to the box. Here's what I tried.

Code: Select all

OnRecognition(StreamNum,StreamPos,RecogType,Result){
	sText:= Result.PhraseInfo().GetText() ; Grab the text we just spoke and go to that subroutine
		;pspeaker.Speak("You said " sText) 	
		;addMsgBox, Command is %sText%	
	if (Responses[sText])                ;If text is found as a key in the object then... 
		{
		gosub % Responses[sText] ;jump to the gosub ;This works for all my commands
		}
		else
		{
		Sendinput,  %sText% ; attempt to send text to chat message box
		}	
	ObjRelease(sText)
I have a command "chat" which brings up the app's chat box and positions the cursor in the box. If the voice text is not a command I want to send it to the chat box.
Ultimately I'll set a toggle and only sendinput if the chat box is active.
This line is not working "Sendinput, %sText% ; attempt to send text to chat message box'
the complete script is attached, it controls the wahoo RGT cycling app using a head set. Most of the commands are for a 2560x1440 screen.
Thanks

[Mod actions: Moved from main section which is for v2, and added [code][/code] tags. Please use them yourself when posting code.]
Attachments
RGT-voice-V4.0.ahk
(11.51 KiB) Downloaded 35 times

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], NimRinon, Spawnova and 97 guests