Can you make Dragon NaturallySpeaking talk using an autohotkey script?
If so, how?
BTW, I was able to achieve this with WSR using this script:
Listener:=ComObjCreate("SAPI.SpSharedRecognizer")
Listener.EmulateRecognition("Time Please")
Not so With Dragon NaturallySpeaking.
Any help will be appreciated, Thanks.
Can you make Dragon NaturallySpeaking talk using an autohotkey script?
- lifeweaver
- Posts: 144
- Joined: 10 May 2014, 05:57
- Location: OH
- Contact:
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
Hi aShai,
I wasn't able to find much information but it looks like Dragon Naturally Speaking has COM interface, which is good news.
Here, and here are two examples of using this interface with AutoHotkey. The second examle has the more recent syntax, you don't want to use the 'COM Standard Library' mentioned.
Perhaps you can track down elgin for more help.
I wasn't able to find much information but it looks like Dragon Naturally Speaking has COM interface, which is good news.
Here, and here are two examples of using this interface with AutoHotkey. The second examle has the more recent syntax, you don't want to use the 'COM Standard Library' mentioned.
Perhaps you can track down elgin for more help.
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
Thanks, lifeweaver for the reply.
-
- Posts: 864
- Joined: 21 Dec 2015, 02:34
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
I use Dragon Naturally Speaking with ahk, so I use voice my commands to run the scripts. But I've never had DNS actually "speak" to me... do you mean have DNS read out loud a passage of text, for example? If so, there are other options as well to do this. Maybe if you clarify what you want to do I could give you a bit more info
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
You don't actually need DNS. Try this using just AHK and SAPI:
Code: Select all
ComObjCreate("SAPI.SpVoice").Speak("Hello. This is an example of using speech.")
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
You can also get Dragon to speak a text.
Using Dragon's own scripting engine should work:
In theory you should also be able to use the DgnVoiceTxt or VTxtAuto COM-interfaces directly, but at least on my machine they're not registered by default, so the above is probably the safest way to do it.
Btw: the EmulateRecognition in your original post does not speak a text but simulates the recognition of a text. The corresponding command for Dragon would be the function RecognitionMimic("text") in the Dragon.DgnEngineControl object.
Using Dragon's own scripting engine should work:
Code: Select all
Listener:= ComObjCreate("Dragon.DgnVCmd.1") ; create Dragon's command object
Listener.Register("", 1) ; register it
Listener.ExecuteScript("TTSPlayString ""This is a test. Did it work?"", """"",0) ; ececute the command TTSPlayString. See Dragon help for details. Watch out for the double quotes in the string!
Sleep, 10000 ; or do something else...
Listener.Unregister() ; unregister your object when you don't need it anymore
Btw: the EmulateRecognition in your original post does not speak a text but simulates the recognition of a text. The corresponding command for Dragon would be the function RecognitionMimic("text") in the Dragon.DgnEngineControl object.
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
Thanks, Elgin
Btw: the EmulateRecognition in your original post does not speak a text but simulates the recognition of a text. The corresponding command for Dragon would be the function RecognitionMimic("text") in the Dragon.DgnEngineControl object.
That's actually, exactly what I wanted was the equivalent of said script.
Listener:=ComObjCreate("SAPI.SpSharedRecognizer")
Listener.EmulateRecognition("Time Please")
Could you show me the equivalent of the Dragon NaturallySpeaking script?
Btw: the EmulateRecognition in your original post does not speak a text but simulates the recognition of a text. The corresponding command for Dragon would be the function RecognitionMimic("text") in the Dragon.DgnEngineControl object.
That's actually, exactly what I wanted was the equivalent of said script.
Listener:=ComObjCreate("SAPI.SpSharedRecognizer")
Listener.EmulateRecognition("Time Please")
Could you show me the equivalent of the Dragon NaturallySpeaking script?
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
Sure:
Code: Select all
DgnEngine:= ComObjCreate("Dragon.DgnEngineControl")
DgnEngine.Register(0)
DgnEngine.RecognitionMimic("what can I say")
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
Thank You Very Much Elgin!!! I Truly Appreciate This!!!
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
Dear Elgin,
Can you please help me write an AHK script that I can use to dictate a voice-command to Dragon.
When I execute the AHK script, I want the script to say the word as a voice command to dragon and dragon to pick it up as someone is dictating using a microphone.
Your help will be really appreciated.
Can you please help me write an AHK script that I can use to dictate a voice-command to Dragon.
When I execute the AHK script, I want the script to say the word as a voice command to dragon and dragon to pick it up as someone is dictating using a microphone.
Your help will be really appreciated.
Elgin wrote:You can also get Dragon to speak a text.
Using Dragon's own scripting engine should work:In theory you should also be able to use the DgnVoiceTxt or VTxtAuto COM-interfaces directly, but at least on my machine they're not registered by default, so the above is probably the safest way to do it.Code: Select all
Listener:= ComObjCreate("Dragon.DgnVCmd.1") ; create Dragon's command object Listener.Register("", 1) ; register it Listener.ExecuteScript("TTSPlayString ""This is a test. Did it work?"", """"",0) ; ececute the command TTSPlayString. See Dragon help for details. Watch out for the double quotes in the string! Sleep, 10000 ; or do something else... Listener.Unregister() ; unregister your object when you don't need it anymore
Btw: the EmulateRecognition in your original post does not speak a text but simulates the recognition of a text. The corresponding command for Dragon would be the function RecognitionMimic("text") in the Dragon.DgnEngineControl object.
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
If you want AHK to do recognition of spoken commands, you can use HotVoice, but this is nothing to do with Dragon.
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
I tried using the codes above for Dragon Practice Medical Edition 4 and they didnt work. Other form of syntax? How do we find these functions?
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
Sorry, can't say as I don't have access to the Dragon Practice versions.
Your first step should be to look at the manuals and help files that come with it (shocking, I know...). The normal Dragon comes with a help file explaining a good part of the API.
If that doesn't help and you want to find out if there is a COM interface and what its functions are, you can get TypeLib2AHK here:
https://github.com/Elgin1/TypeLib2AHK or use any other tools for reading out type libraries.
Look through the list for anything with "DNS", "Dragon", "Nuance" or whatever sounds like it might be an API for Dragon. If there's something like "DNSTools" then it might be similar to what is being used above for the normal Dragon versions.
Regedit can also be a good start to figure out which COM interface - if any - might belong to it.
Your first step should be to look at the manuals and help files that come with it (shocking, I know...). The normal Dragon comes with a help file explaining a good part of the API.
If that doesn't help and you want to find out if there is a COM interface and what its functions are, you can get TypeLib2AHK here:
https://github.com/Elgin1/TypeLib2AHK or use any other tools for reading out type libraries.
Look through the list for anything with "DNS", "Dragon", "Nuance" or whatever sounds like it might be an API for Dragon. If there's something like "DNSTools" then it might be similar to what is being used above for the normal Dragon versions.
Regedit can also be a good start to figure out which COM interface - if any - might belong to it.
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
I get an error using TypeLib2AHK. Sorry I am a Noob at this. Do I need to place this in a different folder?
- Attachments
-
- image.png (7.33 KiB) Viewed 2843 times
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
You need to download all the files, not just the one ahk file. Best choose download as zip and unpack on your machine.
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
Yes I downloaded as a zip file. Should I put libraries in the are it’s searching for c:windows\systrm32 or a different directory tree. I’ll play with it on another machine as well.
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
The script just needs the same folder structure as in Github, so unpacking the zip as is to (almost) anywhere (c:\copy, Documents, or whatever...) should do fine.
Are you forcing AHK to run in that folder instead of the script folder maybe?
Are you forcing AHK to run in that folder instead of the script folder maybe?
Re: Can you make Dragon NaturallySpeaking talk using an autohotkey script?
Hi,
can I ask some help for the following problem ? I want to activate/inactivate Dragon option correction by double click. My script is :
However
doesn't work to change the option's value
What should I make different ?
can I ask some help for the following problem ? I want to activate/inactivate Dragon option correction by double click. My script is :
Code: Select all
dgnengoptionDoubleClickForCorrection := 0x11
DgnEngine:= ComObjCreate("Dragon.DgnEngineControl")
DgnEngine.Register(0)
DgnEngine.Option(dgnengoptionDoubleClickForCorrection) = not DgnEngine.Option(dgnengoptionDoubleClickForCorrection)
DgnEngine.Unregister(0)
Code: Select all
DgnEngine.Option(dgnengoptionDoubleClickForCorrection)= not DgnEngine.Option(dgnengoptionDoubleClickForCorrection)
doesn't work to change the option's value
What should I make different ?
Who is online
Users browsing this forum: balawi28, Chunjee, moltenchees and 257 guests