Community Question

Here is a little project I have been working on with fellow forum member Bob Houston.... It was originally written by another forum member Louis Vazquez.... who really did a good job on this... I have tweaked it a little to try and make it more adaptable from project to project.... It works like sound servo, but using text to drive the servo instead of sound....

I have Luis' permission to post so here it is...


Textservotospeech.EZB

I have posted it to the cloud as well...
CochranRobotics
Commented February 2015
Make a script that is called to handle the function of evaluating the text. This one does that.

In your other scripts, set the $sent = "whatever you want to say"

Then

Call this script.
Richard R
Commented February 2015
You could also use waitforchange on the $sent.... The draw back is you couldn't say the same phrase twice in a row.....
CochranRobotics
Commented February 2015

Code:


.
.
.
sayezb("What you want to say")
.
.
.



would be changed to if you are using the Script Manager which I would recommend.

Code:


.
.
.
$sent = "What you want to say"
ControlCommand("Script Manager", ScriptStart, "Text Speech Engine")
SLEEP(2000) #added to wait for the script to process. May not be needed.
.
.
.


[edit]
The WaitForChange($Sent) would need to be added to the Text Speech Engine. As soon as it got done speaking or maybe just before, you could
$Sent = "" so that the script would have time to evaluate what it needs to before the variable is set to "" again.

This would allow you to just use

$sent = "What you want to say" instead of SAYEZB( "What you want to say" )

you would need to put the Text Speech Engine in a loop and call it at the start of the project in an init or startup script.

Good point Rich and Richard.

Rich
Commented February 2015
@Richard Unless you have the $sent variable "reset" to something immediately after waitforchange
Richard R
Commented February 2015
Ok... I figured a repeatuntil loop in the speech engine (to keep it running) could be used and a waitforchange right after the repeatuntil command...
Question
AvatarRichard R
Asked on Monday, January 19, 2015