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:
Copy      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: 1,229)
#2
is there a way to Speak text and a string at the same time ?
Code:
Copy      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.
 
Code:
Copy      Help
str s
s.getsel ;;store selected text into variable s
Speak s


What am I doing wrong?
#5
Try flag 1.

Or maybe getsel does not work well. Try getclip.


Macro Macro2992
Code:
Copy      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.
#7
Thumbs Up 
Useful feature Smile
but what does "flag 1" you guys says mean?
#8
Flags are parameters you can pass to the function

read more about flags here
Flags


In this particular case flag 1 means
  1 - synchronous (wait until stops speaking).

to see the all the parameters of a function, in the qm editor left click the function name and look at the qm status bar(bottom of qm main window)
   

or you can left click and press F1 to open the function help(will appear below qm editor in main qm window) to read more.

   


Forum Jump:


Users browsing this thread: 2 Guest(s)