Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Speak text
#1
Speaks text. Works on Windows XP. For other OS, you need to install SAPI 5 speech engine (see comments in code), although I did not tested it on other OS. Tested with QM 2.1.5 and later, and possibly will also work with QM 2.1.0 and later.

Download and import the attachment. To speak text, use code like this:

Code:
Select All      Help
Speak "text"

Note: You don't need this if you have QM 2.1.8 or later.


Attached Files
.qml   Speak.qml (Size: 2.5 KB / Downloads: 668)
#2
is there a way to Speak text and a string at the same time ?
Code:
Select All      Help
str line1="text in string"

Speak "HI THERE" line1

something like this, speak the text then the string
#3
str line1="text in string"

str s.from("Hi THERE" " " line1)
Speak s

interesting note: HI speaks as H I, but Hi speaks as one word.
#4
Hello Gintaras,

I want to use the Speak command to read the clipboard contents (text) from text selected in any window. When I test the command from within QM it works (i.e it reads the script contents when I select it) However if I create an executable from the script and try it in another application like Notepad that window loses focus and I get a 'Waiting while the window is hung' message.

BTW I am using Dragon NaturallySpeaking to launch the Exe file.

I've done something similar before with AHK and it worked with the following code:

tts := clipboard
ComObjCreate("SAPI.SpVoice").Speak(tts) 

Now with QM:

Macro Macro1
Trigger SF9     Help - how to add the trigger to the macro
Code:
Select All      Help
str s
s.getsel ;;store selected text into variable s
Speak s


What am I doing wrong?

PS, QM is a wonderful program and it was definitely worth the $60!

Rob
#5
Try flag 1.

Or maybe getsel does not work well. Try getclip.


Macro Macro2992
Code:
Select All      Help
spe 100
key Cc
str s.getclip
Speak s 1
#6
Thank you![Image: smile.png]

It was both flag 1 and getclip that did the trick. 

Rob


Forum Jump:


Users browsing this thread: 1 Guest(s)