
Dunning-Kruger
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...
The Sound servo can control concurrent servos?
Thanks,
Aliusa
You can drive more than one servo port with the script too...
I am not bashing this at all as it is great for short phrases, but long text takes too long to parse and it doesn't work nearly as well.
The board i am looking at is
here.
If you feel like building it, here are the details.
build one for about $20 USD
edit to add more info
string length 2559
CPU at 35%
Memory at 21%
Disk activity at 1%
Parsing string and building OWC string.
Started at 2:01:35
Finished at 2:05:24
While not running this process, CPU at 30%
Here is the text that was being parsed.
"M5 J4A M42One lane closed due to broken down vehicle on M5 Southbound between J4A M42 and J5 A38 Droitwich / Wychbold. M61 J8 A674 ChorleyQueueing traffic and Main carriageway closed due to multi-vehicle accident on M61 Northbound between J6 A6027 Horwich and J8 A674 Chorley. Royston - A10 A505A10 both ways closed due to accident, two vehicles involved between A505 and Royston Road Melbourn turn off. Earith - A1123 Hill Row Causeway Long DroveA1123 Hill Row Causeway both ways closed due to serious accident between Long Drove Earith and Church Lane Haddenham. M6 J10 A454 / B4464 Wolverhampton / WalsallOne lane closed and heavy traffic due to accident on M6 Northbound between J10 A454 / B4464 Wolverhampton / Walsall and J10A M54. Hollym - A1033 Hollym Road Tithe Barn LaneA1033 Hollym Road both ways closed due to serious accident between Tithe Barn Lane and South Carr Dales Road. M40 J3 A40 / A4094 High Wycombe East / LoudwaterQueueing traffic and lane blocked on exit slip road due to accident, motorcyclist involved on M40 Northbound at J3 A40 / A4094 High Wycombe East / Loudwater, congestion on M40 to J2 A355 Beaconsfield. Burford - A456 Forresters RoadA456 both ways closed due to serious accident near Forresters Road. M1 J15A A43 / A5123 Towcester / Northampton ServicesQueueing traffic due to earlier accident, around eight cars involved on M1 Southbound at J15A A43 / A5123 Towcester / Northampton Services, congestion on M1 to Watford Gap Services. All lanes have been re-opened. Kennford - A38 A380 Splatford SplitSlow traffic due to earlier accident on A38 Northbound near A380 Splatford Split. In the roadworks area. All lanes have been re-opened. Croydon - A212 Wellesley Road Station RoadA212 Wellesley Road Northbound closed, queueing traffic due to burst water main between Station Road and A222 St James's Road, congestion on A212 Park Lane to A232 Barclay Road. M20 J7 A249 Maidstone/Detling HillSlip road onto motorway closed due to queues of lorries on M20 coastbound at J7 A249 Maidstone / Detling Hill. M25 J6 A22 / B2235 GodstoneOne lane closed and very slow traffic due to barrier repairs on M25 anticlockwise between J6 A22 / B2235 Godstone and J5 M26 / A21 Sevenoaks. M20 J8 A20 Leeds Castle / Maidstone ServicesM20 coastbound closed, delays due to Operation Stack between J8 A20 Leeds Castle / Maidstone Services and J9 A20 Ashford. M25 J6 A22 / B2235 GodstoneOne lane closed and heavy traffic due to barrier repairs on M25 anticlockwise between J6 A22 / B2235 Godstone and J5 M26 / A21 Sevenoaks. "
Code:
The top of the file looks like this now.
Cheers
Richard
1. Is it possible to make it so that the command control doesn't have to be put in after every line of text? Perhaps,a way to put it once at the beginning of the script and then any text in that script would be "spoken".
2. Is there a way to get the sound to come out of the EZB rather than the computer? For example a "$SentEZB" command, kind of like "SayEZB".
# speech settings - medium rate of speaking
say($sent2) # or sayEZB(
Change this line from say to sayEZB and the sound will come out of the ezb.
say($sent)
would be changed to
sayEZB($sent)
One down one to go.
Is it possible to make it so that the command control doesn't have to be put in after every line of text? Perhaps, a way to put it once at the beginning of the script and then any text in that script would be "spoken".
In your other scripts, set the $sent = "whatever you want to say"
Then
Call this script.
Code:
would be changed to if you are using the Script Manager which I would recommend.
Code:
[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.