evilC wrote: ↑11 Dec 2018, 14:08Version 0.1.3 released - implemented ghostyzx's request
https://github.com/evilC/HotVoice/releases/tag/v0.1.3
Code: Select all
### Added - Add StopRecognizer() endpoint
HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Awesome! Thanks a lot!
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Hi evilC, yes sorry, I didn't mean arbitary words, I was meaning to specify the 'input/recognised strings' but I was curious -- because I couldnt figure out how to -- how make it accept multiple words as an defined string.
So, rather than just a single word, several words, so eg. "Open Word" and "Open Excel" were both defined as trigger words.
Is that possible? I had a look at the Demo.ahk but I couldn't figure it -- I've had a hack around with the simple demo which works great, could you shed any light on how to adapt it to cope with multi-word strings like above?
Thanks a million. Love the potential of this!
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Here is the pertinent code from the demo - it creates the grammar "Call [Anne|Mary|James|Sam] on [his|her] [cell|home|work] phone"
Where [his|her] etc is a choice.
You would want to set up a grammar like "Launch [Word|Excel|PowerPoint]"
Where [his|her] etc is a choice.
You would want to set up a grammar like "Launch [Word|Excel|PowerPoint]"
Code: Select all
contactGrammar := hv.NewGrammar()
contactGrammar.AppendString("Call")
femaleGrammar := hv.NewGrammar()
femaleChoices := hv.NewChoices("Anne, Mary")
femaleGrammar.AppendChoices(femaleChoices)
femaleGrammar.AppendString("on-her")
maleGrammar := hv.NewGrammar()
maleChoices := hv.NewChoices("James, Sam")
maleGrammar.AppendChoices(maleChoices)
maleGrammar.AppendString("on-his")
contactGrammar.AppendGrammars(maleGrammar, femaleGrammar)
phoneChoices := hv.NewChoices("cell, home, work")
contactGrammar.AppendChoices(phoneChoices)
contactGrammar.AppendString("phone")
hv.LoadGrammar(contactGrammar, "CallContact", Func("CallContact"))
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Actually, the Choices Example.ahk file is a much simpler example
Here is it roughly adapted to what you want (Not tested)
Here is it roughly adapted to what you want (Not tested)
Code: Select all
#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 "Open" to it
testGrammar.AppendString("Open")
; Create a new Choices object with choices
appChoices:= hv.NewChoices("Word, Excel, PowerPoint, Outlook")
; Add the choices to the Grammar
testGrammar.AppendChoices(appChoices)
; Load the Grammar
hv.LoadGrammar(testGrammar, "OpenApp", Func("MyFunc"))
hv.StartRecognizer()
return
MyFunc(grammarName, words){
ToolTip % "Command: " grammarName " " words[2]
}
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Thinking about it, I suppose it would be entirely possible to write some code such that you could just supply a string in the form "Launch [Word|Excel|PowerPoint]" and it just works it out for you - If I get some time at some point, I will look into it.
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
OMG... on closer scrutiny I found what I was trying to say evilC...
... all I was trying to figure out was how to post multiple word triggers, eg. "Fry Eggs", "Cook Bacon" etc... the answer I see now was...
A humble... -
So, cook-bacon, fry-eggs --- just using a - lets you have multiple word triggers.
Sorry to have troubled you / and the crossed wires!
... all I was trying to figure out was how to post multiple word triggers, eg. "Fry Eggs", "Cook Bacon" etc... the answer I see now was...
A humble... -
So, cook-bacon, fry-eggs --- just using a - lets you have multiple word triggers.
Sorry to have troubled you / and the crossed wires!
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
If you are adding words such as "Open-Word" "Close-Word" etc then while it will work, this is not the best way to do it.
You want to build the phrase "[Open|Close] [Word|Excel|Powerpoint]"
That way, you need one phrase, and it handle both open or close commands for any of the specified apps.
If you said "Open Word", then MyFunc would get called, and words[1] would be "Open" and words[2] would be "Word".
You want to build the phrase "[Open|Close] [Word|Excel|Powerpoint]"
That way, you need one phrase, and it handle both open or close commands for any of the specified apps.
If you said "Open Word", then MyFunc would get called, and words[1] would be "Open" and words[2] would be "Word".
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Just stumbled upon this and downloaded the repo, however it seems the file hotvoice.dll is missing from lib dir, script throws error message saying "unable to find lib\hotvoice.dll, exiting..."
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Use Hotvoice.zip on the 'releases' page for download: https://github.com/evilC/HotVoice/releases
It contains the folder named lib and the dll (among other files).
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
As gregster, and the instructions say:
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Cool thanks guys, I will after work
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Thank you very much for your work, it is a wonderful project and gives me a lot of pleasure.
I would like to solve the following issue, maybe i just miss something.
My voice input starts with a Grammar Objects 'move'. In a NewChoice object I have two possibilities 'x, y'. but I want to cover three cases:
- move
- move x
- move y
So in case I pronounce move without x or y, the NewChoice value remains empty and I can continue working with it.
I think I'm too stupid for that. Inserting an empty string with hv.NewChoices("x, y, ") doesn't work, but would be a great way. As I understand it now, the NewChoice object forces an input and can't be empty.
Are there ways to solve this within a Grammer object?
I'm sorry if I didn't understand something and also for my bad English.
Thank You!
#######################
moveGrammar := hv.NewGrammar()
moveGrammar.AppendString("move")
move_directionPhrase := hv.NewGrammar()
move_directionChoices := hv.NewChoices("x, y")
move_directionPhrase.AppendChoices(move_directionChoices)
moveGrammar.AppendGrammars(move_directionPhrase)
LV_Add(, "Move", hv.LoadGrammar(moveGrammar, "Move", Func("Move")))
#######################
I would like to solve the following issue, maybe i just miss something.
My voice input starts with a Grammar Objects 'move'. In a NewChoice object I have two possibilities 'x, y'. but I want to cover three cases:
- move
- move x
- move y
So in case I pronounce move without x or y, the NewChoice value remains empty and I can continue working with it.
I think I'm too stupid for that. Inserting an empty string with hv.NewChoices("x, y, ") doesn't work, but would be a great way. As I understand it now, the NewChoice object forces an input and can't be empty.
Are there ways to solve this within a Grammer object?
I'm sorry if I didn't understand something and also for my bad English.
Thank You!
#######################
moveGrammar := hv.NewGrammar()
moveGrammar.AppendString("move")
move_directionPhrase := hv.NewGrammar()
move_directionChoices := hv.NewChoices("x, y")
move_directionPhrase.AppendChoices(move_directionChoices)
moveGrammar.AppendGrammars(move_directionPhrase)
LV_Add(, "Move", hv.LoadGrammar(moveGrammar, "Move", Func("Move")))
#######################
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Hmm,, I am not sure how you would handle that case
Rather than move [x|y], fave you tried [move|move x|move y] ?
Rather than move [x|y], fave you tried [move|move x|move y] ?
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
HotVoice 0.1.4 has been released!
The demo has been greatly improved, and now supports selecting language
The demo also now has commands for French as well as English, and should not crash if recognizer 0 is not English
IF YOU SPEAK A NON-ENGLISH LANGUAGE, PLEASE HELP ME UPDATE THE DEMO WITH OTHER LANGUAGES!
The demo has been greatly improved, and now supports selecting language
The demo also now has commands for French as well as English, and should not crash if recognizer 0 is not English
IF YOU SPEAK A NON-ENGLISH LANGUAGE, PLEASE HELP ME UPDATE THE DEMO WITH OTHER LANGUAGES!
-
- Posts: 934
- Joined: 30 Sep 2017, 03:59
- Location: Romania
- Contact:
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
I speak Romanian. Eager to help. Would you like Romanian? ^_^
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
I could add Spanish to it, I did use this a few months ago and it was really cool.
Will try to get some spare time and try to add something to the demo.
Will try to get some spare time and try to add something to the demo.
-
- Posts: 854
- Joined: 21 Dec 2015, 02:34
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
Hey I was just wondering, can anyone confirm this works on Windows 7? I get the following error when trying to run the script:
HotVoice.dll failed to load
Dll may be blocked. Try running the powershell command Get-ChildItem -Path '.'-Recurse Unblock-File in the script folder
So then I right-click the file named "Unblocker.ps1" and select 'Run With Powershell'. It opens up an ms-dos window and hangs for a few seconds.
But then same problem all over again, and I get the same error message.
It would be amazing if I could get this working
HotVoice.dll failed to load
Dll may be blocked. Try running the powershell command Get-ChildItem -Path '.'-Recurse Unblock-File in the script folder
So then I right-click the file named "Unblocker.ps1" and select 'Run With Powershell'. It opens up an ms-dos window and hangs for a few seconds.
But then same problem all over again, and I get the same error message.
It would be amazing if I could get this working
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
The powershell script needs to be run as admin
A simpler solution is just to right click the zip, select properties, check the unblock checkbox, then unzip the zip
A simpler solution is just to right click the zip, select properties, check the unblock checkbox, then unzip the zip
-
- Posts: 854
- Joined: 21 Dec 2015, 02:34
Re: HotVoice - Speech Recognition + Volume detection for AHK (C# DLL)
no luck. no matter what I do, the same error message keeps popping up. It's a shame, it looks like the demand for this script is huge- lots of users are interested.
I'm thinking this might be a win7 vs. win10 issue?
I'm thinking this might be a win7 vs. win10 issue?
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 217 guests