Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Speech Recognition


  • Please log in to reply
13 replies to this topic
Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010

"Computer, how can the net amount of entropy of the universe be massively decreased?"

"INSUFFICIENT DATA FOR MEANINGFUL ANSWER"

 

- The Last Question

 

Speech recognition with Microsoft's SAPI. A simple SpeechRecognizer class provides a quick and easy way to use speech recognition in your scripts.

 

Inspired by some prototype code made a long time ago.

 

Documentation and examples are included at the top of the file.

 

NOTE: Microsoft SAPI is required. If you don't have it, you can get it at MSDN.

 

DOWNLOAD



guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
nice quote wink.png

PointCloud
  • Members
  • 4 posts
  • Last active: Sep 30 2013 08:59 PM
  • Joined: 03 Sep 2013

I seem to be lost with this one.  I am noobie so forgive me please.  Does this script go into my Lib or is it the same folder the with one of the examples you have documented up top? 

 

I would love to get this to work.  The example with the list of words seems like somthing I have been looking into.  It would help with errors and wrong hotkey commands.  I honestly can't wait to get this to work.  

 

Thank you for your time and effort!



Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010

There are multiple ways to go about using libraries such as this one:

  1. This is my preferred way of doing it: download the Gist and extract the file. You should have a file named Speech Recognition.ahk. Place this folder in the same folder as your script. In your script, near the top, use "#Include Speech Recognition.ahk", without the quotes. Now, in your script, you can use the library just like in the examples. Plus, if you compile it, it'll all get merged into the EXE automatically, so you only need that EXE.
  2. This is the library method: same as above, but place Speech Recognition.ahk into one of the Lib locations, which include the Documents folder and the script folder. Now, you can use #Include <Speech Recognition> and you can use the library just like in the examples.
  3. This is the direct-copying method: if all else fails, just copy all the code into your script, maybe the top or bottom. It's not too bad in this case since the code isn't really that long.

Feel free to ask for clarification.



PointCloud
  • Members
  • 4 posts
  • Last active: Sep 30 2013 08:59 PM
  • Joined: 03 Sep 2013

I tried all three ways just to become familiar and I got them all to work.   Plus every example you posted worked all three ways.

Thank you very much for you help and the Lib.:D This is a really special script.   The list with some extra IF statements will solve a ton of issues with accuracy.

I can't thank you enough for taking the time to put this all together.   Here is a start though....

I have a family member who is physically disabled after a 3rd tour in middle east.  The loss of motor skills in what was left of his hands don't allow him to use a computer in a way that is not frustrating to him.  So for the last 2 years I have been setting up things for him to make it easier to get what he wants out of the computer faster. All Things like hacking keyboard/mice, speech recognition, and a myriad of other things to explore interfacing with the computer.

I began with the windows speech recognition and it was not up to par.  So I started using Voxcommando and Eventghost for his set up.  Which for the most part is the only customizable option out there with some good documentation on the Vox side and affordable.  He still uses it today but voxcommando is more catered to XMBC and EventGhost.  Which creates a mess of work in some cases to get a command to function proper.  He is a jar head by nature and EventGhoast is complicated.  Plus their forums got post for on the front page for weeks with no reply's.  So basically the system I have to work with now is really unteachable to most folks and has to many dependencies. Plus a whole lot more issues to long for a post. (sorry for ranting)Basically.....

AutoHotkey+Your Work+ My Work := a better life for him and perhaps others.

You opened a huge door for me with this little script and I appreciate it.

Going to bury my head in the documentation now.

Cheers!



lblb
  • Members
  • 120 posts
  • Last active: Dec 02 2015 08:05 AM
  • Joined: 22 May 2012

Hi Uberi,

 

This is very cool. I hadn't seen your nice script until it was linked to in the help section but I can now see a few uses for this.

 

I got it to do different actions when a certain string/word is recognized (using "If text = word" statements). Do you know if there is a way to reduce the delay between when a the end of a word is spoken and the system recognizing and responding? With the code you shared, there seems to be a 1-2 second delay between when I stop speaking and when a command is sent after the word is recognized.

 

Thanks again for this great lib! 



Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010

Hi Uberi,

 

This is very cool. I hadn't seen your nice script until it was linked to in the help section but I can now see a few uses for this.

 

I got it to do different actions when a certain string/word is recognized (using "If text = word" statements). Do you know if there is a way to reduce the delay between when a the end of a word is spoken and the system recognizing and responding? With the code you shared, there seems to be a 1-2 second delay between when I stop speaking and when a command is sent after the word is recognized.

 

Thanks again for this great lib! 

 

Hey PointCloud:

 

Unfortunately not, the speech recognizer is already working as fast as I could get it to. This seems to be the processing delay. On my computer though, it's more like around half a second.



lblb
  • Members
  • 120 posts
  • Last active: Dec 02 2015 08:05 AM
  • Joined: 22 May 2012

Hi Uberi

Thanks for the quick reply. The delay indeed seems to vary a bit depending on which computer I use the script on but it's not that much of a bother. Thanks again for this very useful lib.



EFH
  • Members
  • 4 posts
  • Last active: May 05 2015 03:04 PM
  • Joined: 14 Mar 2012

I am just starting to play with this script. I have a failed attempt running at the house, but have it working at work.

 

Here I am getting words recognized that are not listed in the grammar. Am I incorrect in thinking that only the words listed in Recognizer.Recognize(["word","other","test"]) should be identified? I am getting responses in the example for spoken numbers such as "Southern" in place of "Seven". I understand that were I to train the speech API more, the errors would go down and recognition would increase, but with a grammar established, should not the recognizer simply not identify words outside of its scope? That is to say for the first example in the comments of the script: It should only recongize spoken single digit numbers and sit and wait otherewise, yes?

 

Thank you for your time,

 

 

Edit: I have tried bracketing the range with Recognizer.Listen(0) and (1) to flip it bback and forth. Things worked like this. I removed them and could not duplicate the error. Tests with OnRecognize and limiting the list to two words have worked properly. So maybe I'm wholly off base.

 

Further edit: It seems to be time sensitive. The recognizer starts in dictate mode and eventually settles into its grammar.



aShai
  • Members
  • 12 posts
  • Last active: Feb 07 2016 10:29 PM
  • Joined: 24 Jun 2015

Old thread however is this script still relevant.  I can't seem to get it to work.  Any advice would be appreciated.  Thanks!



bixio
  • Members
  • 5 posts
  • Last active:
  • Joined: 21 Oct 2013

@ Uberi

 

Hi, I wanted to ask a couple of things if possible ...
I use a Seven Ultimate SP1 X86  EN  "lite"  but WITHOUT  Sapi support.
What should I downloaded as Sapi type of SDK , so you can use your library ?
Link?

Many thanks for this help. :D



bixio
  • Members
  • 5 posts
  • Last active:
  • Joined: 21 Oct 2013

@ Uberi

 

Hi, I wanted to ask a couple of things if possible ...
I use a Seven Ultimate SP1 X86  EN  "lite"  but WITHOUT  Sapi support.
What should I downloaded as Sapi type of SDK , so you can use your library ?
Link?

Many thanks for this help. :D

Nobody?
Interested specify which version of the SDK should be used with Seven SP1 ...



bixio
  • Members
  • 5 posts
  • Last active:
  • Joined: 21 Oct 2013

Speech recognition with Microsoft's SAPI. A simple SpeechRecognizer class provides a quick and easy way to use speech recognition in your scripts.

 

Inspired by some prototype code made a long time ago.

 

Documentation and examples are included at the top of the file.

 

NOTE: Microsoft SAPI is required. If you don't have it, you can get it at MSDN.

 

DOWNLOAD

This is ok for Seven and your script?

https://www.microsof...ls.aspx?id=8442

 

edit: i have remove native Speeck Engine support in my Seven Lite EN x86...



titep
  • Members
  • 2 posts
  • Last active:
  • Joined: 26 Aug 2015

:(( It doesn't work on me.

 

 

I use the code as in the second example:

s := new SpeechRecognizer
s.Recognize(True)
Text := s.Prompt()

TrayTip, Speech Recognition, You said: %Text%
Sleep, 3000
ExitApp

but It quit after 3second without showing any Traytips! I use windows 10.