HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)

Post your working scripts, libraries and tools
burque505
Posts: 492
Joined: 22 Jan 2017, 19:37

Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)

02 Jun 2018, 11:31

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:
IDs.PNG
IDs.PNG (4.72 KiB) Viewed 296 times

Regards,
burque505
burque505
Posts: 492
Joined: 22 Jan 2017, 19:37

Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)

02 Jun 2018, 12:42

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:
IDs.PNG
IDs.PNG (4.72 KiB) Viewed 285 times

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] [Expand] [Download] GeSHi © Codebox Plus


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:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



English, German and Spanish all work with the simple examples.

Regards,
burque505
Last edited by burque505 on 02 Jun 2018, 12:57, edited 1 time in total.
User avatar
evilC
Posts: 4231
Joined: 27 Feb 2014, 12:30

Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)

02 Jun 2018, 12:55

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
burque505
Posts: 492
Joined: 22 Jan 2017, 19:37

Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)

02 Jun 2018, 12:59

:) 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:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

User avatar
evilC
Posts: 4231
Joined: 27 Feb 2014, 12:30

Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)

02 Jun 2018, 13:22

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.
burque505
Posts: 492
Joined: 22 Jan 2017, 19:37

Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)

02 Jun 2018, 13:38

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.
Spoiler

Edit: Glitch. TStill tinkering, but this works.

Regards,
burque505
ArchCrunch
Posts: 2
Joined: 05 Jul 2018, 17:35

Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)

05 Jul 2018, 17:41

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
ArchCrunch
Posts: 2
Joined: 05 Jul 2018, 17:35

Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)

08 Jul 2018, 08:09

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?
User avatar
evilC
Posts: 4231
Joined: 27 Feb 2014, 12:30

Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)

09 Jul 2018, 07:31

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".
atxbilly
Posts: 1
Joined: 12 Jul 2018, 14:09

Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)

12 Jul 2018, 14:18

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!

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 16 guests