[Solved]Adding quotes around an exec node parameter

I'm wanting to try and use espeak on a Pi for text to speech but having a problem in passing my text with quotes around it

If you just use (from a command line)
espeak alexa, what is the time

then it only says alexa
but works fine with
espeak "alexa, what is the time"

I can't work out how to add quotes around my phrase when using the exec node to do the work from within Node-RED

I send text to exec running espeak which saves it as a file and then use aplay to hear the file

I can do it with a function node

image

but I'm wondering if there's a non-function node method instead?
PS you need to
sudo apt-get install espeak
if you want to play with this

I've remembered about the template node :slight_smile:
image

Doesn't it work if the exec command is espeak + any flags and you append the payload alexa, what is the time? (I don't have an alexa or espeak, but that works with echo -n )

No - it doesn't work just appending the payload as the payload needs to have quotes around it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.