It runs on the machine running node-red via and exec node, here is a simple flow I run on a RasperryPi2:
[
{
"id": "d804870f.124488",
"type": "change",
"z": "7fdf004e.28b08",
"name": "unspecified",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "\"'Person Detected on New Camera'\"",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "Espeak",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1150,
"y": 445,
"wires": [
[
"1bda63c8.b77b4c"
]
]
},
{
"id": "1bda63c8.b77b4c",
"type": "delay",
"z": "7fdf004e.28b08",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "4",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"outputs": 1,
"x": 1340,
"y": 285,
"wires": [
[
"ea43c065.505fb"
]
]
},
{
"id": "91ec5895.5a45d8",
"type": "mqtt in",
"z": "7fdf004e.28b08",
"name": "espeak",
"topic": "Espeak",
"qos": "2",
"broker": "313c03c1.be782c",
"inputs": 0,
"x": 1325,
"y": 215,
"wires": [
[
"79a966b3.dee288",
"ea43c065.505fb"
]
]
},
{
"id": "b1e96bf1.90dd28",
"type": "inject",
"z": "7fdf004e.28b08",
"name": "speak test",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "Espeak",
"payload": "'\"Multi word test\"'",
"payloadType": "str",
"x": 1345,
"y": 165,
"wires": [
[
"ea43c065.505fb",
"79a966b3.dee288"
]
]
},
{
"id": "79a966b3.dee288",
"type": "exec",
"z": "7fdf004e.28b08",
"command": "/usr/bin/espeak",
"addpay": true,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": true,
"name": "Espeak",
"x": 1550,
"y": 285,
"wires": [
[
"7bd6ee8b.f3e1a"
],
[
"7bd6ee8b.f3e1a"
],
[
"7bd6ee8b.f3e1a"
]
]
},
{
"id": "ea43c065.505fb",
"type": "debug",
"z": "7fdf004e.28b08",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 1550,
"y": 215,
"wires": []
},
{
"id": "7bd6ee8b.f3e1a",
"type": "debug",
"z": "7fdf004e.28b08",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 1720,
"y": 285,
"wires": []
},
{
"id": "313c03c1.be782c",
"type": "mqtt-broker",
"name": "localhost:1883",
"broker": "localhost",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"closeTopic": "",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": ""
}
]
It can take messages from the local server, or from other systems via MQTT. I've used it both ways. You install it via apt. Once you have your Pi setup to play audio, you can do: sudo apt install espeak and then in a terminal window test it with: espeak "Hello World"