Asked — Edited

Text To Servo Speech Engine

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...


ARC Pro

Upgrade to ARC Pro

Stay at the forefront of robot programming innovation with ARC Pro, ensuring your robot is always equipped with the latest advancements.

#41  

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.

#42  

You could also use waitforchange on the $sent.... The draw back is you couldn't say the same phrase twice in a row.....

#43  

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

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


.
.
.
$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.

United Kingdom
#44  

@Richard Unless you have the $sent variable "reset" to something immediately after waitforchange

#45  

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...