I tried the CultureOptimize DLL, getting this error still:
[deleted]
EDIT: Error gone, so I deleted it. I restarted, and all was well.
I really appreciate you taking the time and effort for this, by the way, thanks.
Just a note: It appears the ID number is related to the order in which recognizers are installed. I installed German first, English second, Spanish third (for whatever reason).
Here's how the IDs show up:
Regards,
burque505
HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
No problem
So that last DLL made a difference?
If you had to take special steps to get it to work on Win7, if you could summarize them so I could update the docs, that would be great.
So that last DLL made a difference?
If you had to take special steps to get it to work on Win7, if you could summarize them so I could update the docs, that would be great.
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Here's what I did to get HotVoice working on my Win7 SP1 64-bit machine:
1) In general, I followed the instructions on this page.
2) First, I downloaded and installed the 64-bit Version 11 Speech Platform runtime from here.
3) Second, I downloaded and installed the 64-bit Version 11 Speech Platform SDK from here.
4) Third, I downloaded and installed several Version 11 languages from here.
I also switched out the included HotVoice.dll for the CultureOptimize.zip version evilC provided above. I'm not sure if this step was required or not, but it certainly did not hurt.
The ID number of the installed language appears to be determined by installation order, and not by the default language of my OS. I installed German first, English second, and Spanish third (although I had intended to install English first, I clicked on the wrong installer). The IDs display as below: To my surprise, recognition works in English for the Demo.ahk script using all four of the recognizers shown, including the Microsoft Lightweight Speech Recognizer.
Here is a test script based on Simple Example.ahk, which works for me:
Note the ID in the script needed to match the ID for the recognizer. In the following script it's changed to '2' for Spanish:
English, German and Spanish all work with the simple examples.
Regards,
burque505
1) In general, I followed the instructions on this page.
2) First, I downloaded and installed the 64-bit Version 11 Speech Platform runtime from here.
3) Second, I downloaded and installed the 64-bit Version 11 Speech Platform SDK from here.
4) Third, I downloaded and installed several Version 11 languages from here.
I also switched out the included HotVoice.dll for the CultureOptimize.zip version evilC provided above. I'm not sure if this step was required or not, but it certainly did not hurt.
The ID number of the installed language appears to be determined by installation order, and not by the default language of my OS. I installed German first, English second, and Spanish third (although I had intended to install English first, I clicked on the wrong installer). The IDs display as below: To my surprise, recognition works in English for the Demo.ahk script using all four of the recognizers shown, including the Microsoft Lightweight Speech Recognizer.
Here is a test script based on Simple Example.ahk, which works for me:
Code: Select all
; Simple German example
; Test of German recognition
; This script demonstrates a single initial word ("Bundesrepublik")
#SingleInstance force
#Persistent ; You will need this if your script creates no hotkeys or has no GUI
; Load the HotVoice Library
#include Lib\HotVoice.ahk
; Create a new HotVoice class
hv := new HotVoice()
; Initialize HotVoice and tell it what ID Recognizer to use
hv.Initialize(0)
; Create a new Grammar
testGrammar := hv.NewGrammar()
; Add the word "Test" to it
testGrammar.AppendString("Bundesrepublik")
; Load the Grammar
hv.LoadGrammar(testGrammar, "Bundesrepublik", Func("MyFunc"))
hv.StartRecognizer()
return
MyFunc(grammarName, words){
ToolTip % "Command: " grammarName " was triggered @ " A_TickCount " with " words.Length() " words"
}
Code: Select all
; Test of Spanish recognition
; This script demonstrates a phrase("Me gustaría ir a la playa")
#SingleInstance force
#Persistent ; You will need this if your script creates no hotkeys or has no GUI
; Load the HotVoice Library
#include Lib\HotVoice.ahk
; Create a new HotVoice class
hv := new HotVoice()
; Initialize HotVoice and tell it what ID Recognizer to use
hv.Initialize(2)
; Create a new Grammar
testGrammar := hv.NewGrammar()
; Add the word "Test" to it
testGrammar.AppendString("Me gustaría ir a la playa")
; Load the Grammar
hv.LoadGrammar(testGrammar, "Me gustaría ir a la playa", Func("MyFunc"))
hv.StartRecognizer()
return
MyFunc(grammarName, words){
ToolTip % "Command: " grammarName " was triggered @ " A_TickCount " with " words.Length() " words"
}
Regards,
burque505
Last edited by burque505 on 02 Jun 2018, 12:57, edited 1 time in total.
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Hmm, is Speech Recognition easier to process in German, what with you guys munging words together like that?
Thanks for the list - so it appears that you did not need any of the things outside of stuff that I had linked, but maybe some of the things that I marked as either/or bitness-wise, you actually needed both?
If the CultureOptimize version does not break anything, I think I will commit it then, as it seems a lot more sensible
Thanks for the list - so it appears that you did not need any of the things outside of stuff that I had linked, but maybe some of the things that I marked as either/or bitness-wise, you actually needed both?
If the CultureOptimize version does not break anything, I think I will commit it then, as it seems a lot more sensible
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Well, English is my native language, so I'm probably hammering both German and Spanish, but they both work.
In my case, I'm not sure whether some of what I did was optional. But the CultureOptimize version definitely did not break anything for me.
Here's another example in German based on Choices.ahk:
In my case, I'm not sure whether some of what I did was optional. But the CultureOptimize version definitely did not break anything for me.
Here's another example in German based on Choices.ahk:
Code: Select all
; This script demonstrates a single initial word ("Testen"), followed by a choice of "rauf", "runter", "links" or "rechts"
#SingleInstance force
#Persistent ; You will need this if your script creates no hotkeys or has no GUI
; Load the HotVoice Library
#include Lib\HotVoice.ahk
; Create a new HotVoice class
hv := new HotVoice()
; Initialize HotVoice and tell it what ID Recognizer to use
hv.Initialize(0)
; Create a new Grammar
testGrammar := hv.NewGrammar()
; Add the word "Test" to it
testGrammar.AppendString("Testen")
; Create a new Choices object with four direction choices
directionChoices := hv.NewChoices("rauf, runter, links, rechts")
; Add the direction choices to the Grammar
testGrammar.AppendChoices(directionChoices)
; Load the Grammar
hv.LoadGrammar(testGrammar, "Testen", Func("MyFunc"))
hv.StartRecognizer()
return
MyFunc(grammarName, words){
ToolTip % "Command: " grammarName " " words[2]
}
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Maybe what we should do is instead of use an ID number, use the name of the Culture?
ie, it could maybe be hv.Initialize("DE") or whatever.
I wonder if multiple recognizers can co-exist for different languages?
I suppose I could just add a method to try and find, for example, a german language recognizer and return it's ID.
Then scripts which are inherently german could use this method to get an appropriate ID.
ie, it could maybe be hv.Initialize("DE") or whatever.
I wonder if multiple recognizers can co-exist for different languages?
I suppose I could just add a method to try and find, for example, a german language recognizer and return it's ID.
Then scripts which are inherently german could use this method to get an appropriate ID.
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Maybe so, seeing as the ID _seems_ to be based on installation order of languages. To tell you the truth, I haven't tried any of these scripts leaving the ID at 0 to see if they'll work with all languages, but I will, and I'll edit this post.
EDIT: The ID does definitely make a difference for recognition, although some words get recognized regardless of which ID I choose. Matching the ID to the target language is definitely better.
By the way, for the benefit of those just joining us here's a script which runs Firefox, Word, Excel or Outlook, depending on whether you say "Run Firefox", "Run Word", "Run Excel" or "Run Outlook".
EDITED EDIT:NOT WORKING in a fashion. I have to say "Run Winword", "Run Excel", "Run Firefox", or "Run Excel", but so far it seems accurate.
Glitch. TStill tinkering, but this works.
Regards,
burque505
EDIT: The ID does definitely make a difference for recognition, although some words get recognized regardless of which ID I choose. Matching the ID to the target language is definitely better.
EDITED EDIT:
Spoiler
Edit: Regards,
burque505
-
- Posts: 2
- Joined: 05 Jul 2018, 17:35
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Hi,
Is this working on Windows 10? I am not getting any errors, but the demo doesn't seem to respond at all. The only thing is that the volume is moving a bit when sound occurs, but the text box below appears empty.
Any ideas?
Thanks
Is this working on Windows 10? I am not getting any errors, but the demo doesn't seem to respond at all. The only thing is that the volume is moving a bit when sound occurs, but the text box below appears empty.
Any ideas?
Thanks
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Yup, was developed on Win10
If the volume slider is moving, that's a good sign.
What recognizer are you using?
If the volume slider is moving, that's a good sign.
What recognizer are you using?
-
- Posts: 2
- Joined: 05 Jul 2018, 17:35
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Hi, It worked! I think I was not as loud as I should have been. It is not working 100% of the time though. Is there a way to print what the mic is actually understanding?
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
It can be debugged via the API, but HotVoice does not display it until it is recognized.
How high is the slider moving when you speak? If it is not getting much volume, it might not be that reliable.
I find that with most mics, I need to crank the input level to full and/or enable "Mic Boost".
How high is the slider moving when you speak? If it is not getting much volume, it might not be that reliable.
I find that with most mics, I need to crank the input level to full and/or enable "Mic Boost".
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
I used HotVoice to create a safe word for Path of Exile. Now, when I say, "Bears", it checks to see the game is running and closes it before the bears kill me. I also use it to cast spells hands free. Thanks for the great project!
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
I'm getting the DLLs in the HotVoice Folder are blocked message and have run the powershell command in the lib folder (where the dlls are) and the parent, where Demo.ahk is. Is there a trick for using with Win 8.1 I'm on? I'm more or less following the Win 7 instructions with no luck.
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Are you running it as admin?
Failing that, try right-clicking the DLLs and select properties, see if there is anything in that dialog that allows you to unblock.
Failing that, try right-clicking the DLLs and select properties, see if there is anything in that dialog that allows you to unblock.
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Yup, cmd as admin then into ps did it . . . Thx! Great work. I was tapping into the WSR engine for my earlier efforts with less success. Was I using the lightweight recognizer there?
BTW, is there a typo in line 21 of hv.ahk? "nanme" for "name"? Fixing it seems to not break anything.
BTW, is there a typo in line 21 of hv.ahk? "nanme" for "name"? Fixing it seems to not break anything.
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Awesome library!
I'm trying to find a way to run it nonstop, that means I need to pause the voice recognition from time to time, I need to be able to manually stop&restart the voice recognition (noise in the room, video playing, etc). Right there's only the method StartRecognizer to start things, woudn't be possible to implement also something like StopRecognizer?
Possible workarounds for now are the following:
1) have code in each triggered function that checks if we should be in a "paused" state and ignore the recognitions
2) have the voice recognition code in a separate ahk script and start/stop it on demand
I'm trying to find a way to run it nonstop, that means I need to pause the voice recognition from time to time, I need to be able to manually stop&restart the voice recognition (noise in the room, video playing, etc). Right there's only the method StartRecognizer to start things, woudn't be possible to implement also something like StopRecognizer?
Possible workarounds for now are the following:
1) have code in each triggered function that checks if we should be in a "paused" state and ignore the recognitions
2) have the voice recognition code in a separate ahk script and start/stop it on demand
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Is a trivial addition. Will add once I get a moment. Have raised an issue to remind me.
https://github.com/evilC/HotVoice/issues/2
https://github.com/evilC/HotVoice/issues/2
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
I've been meaning to revisit this speech recognition stuff for ages. Wonderful work @evil_c
I was wondering if you, or someone else could help me understand how to adapt the code to do the following...
Activation word / word listened for ("Test", in the demo you included with the script)
... but then... I'd like to feed it a string, rather than a single word, like the up, down, left, right -- in your example.
Something like this....
Simon (activated)
"Open Microsoft Word" < it would capture and interpret a string rather than a single word.
That would open the opportunity for...
Open Word
Open Excel
Close Word
Close Excel
etc. opens up a lot of opprtunities if it can interpret a string of characters.
I tried adding strings to hv.NewChoices but without success.
Does anyone have an idea of how to do it? Thanks!
I was wondering if you, or someone else could help me understand how to adapt the code to do the following...
Activation word / word listened for ("Test", in the demo you included with the script)
... but then... I'd like to feed it a string, rather than a single word, like the up, down, left, right -- in your example.
Something like this....
Simon (activated)
"Open Microsoft Word" < it would capture and interpret a string rather than a single word.
That would open the opportunity for...
Open Word
Open Excel
Close Word
Close Excel
etc. opens up a lot of opprtunities if it can interpret a string of characters.
I tried adding strings to hv.NewChoices but without success.
Does anyone have an idea of how to do it? Thanks!
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
This library does not support recognition of arbitrary words - you need to give it a list of all possible application names in order to support this.
See how the demo code implements the "call name on their phone" example
See how the demo code implements the "call name on their phone" example
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Version 0.1.3 released - implemented ghostyzx's request
https://github.com/evilC/HotVoice/releases/tag/v0.1.3
https://github.com/evilC/HotVoice/releases/tag/v0.1.3
Code: Select all
### Added
- Add StopRecognizer() endpoint
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: jamith and 208 guests