raspberry pi TTS without using browser

735 views
Skip to first unread message

Roger

unread,
Sep 22, 2017, 4:29:04 PM9/22/17
to Node-RED
Anyone experience with tts on raspberry pi without the use of a webbrowser?
I want to connect a speaker to the audio output of the pi

Have a working solution with use of my browser, but what i am looking for is without the browser

Thanks

Colin Law

unread,
Sep 22, 2017, 5:11:38 PM9/22/17
to node...@googlegroups.com
This link has a number of suggestions for doing text to speech (I
presume that is what you mean by tts) without the use of a browser.
Not sure what the question has to do with node-red though.

http://elinux.org/RPi_Text_to_Speech_(Speech_Synthesis)

Colin
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/94a093b6-9498-41b6-95c7-0ca5e30b3667%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Roger

unread,
Sep 22, 2017, 5:54:22 PM9/22/17
to Node-RED
Thanks Colin!

It has to do with node-red because i use node red for the whole system and want node-red to speak for me.

Nick O'Leary

unread,
Sep 22, 2017, 5:58:28 PM9/22/17
to Node-RED Mailing List
Hi Roger,

I've used espeak (mentioned on the link Colin provided) as a simple way to do TTS. The missing link is to use the node-red exec node to invoke the appropriate command.

Nick



On 22 September 2017 at 22:54, Roger <rog...@qusax.eu> wrote:
Thanks Colin!

It has to do with node-red because i use node red for the whole system and want node-red to speak for me.

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Roger

unread,
Sep 23, 2017, 5:53:42 AM9/23/17
to Node-RED
Thanks guys!!

Testing now with the "play audio node"

But when i use 2 nodes with different language i get the same language from both nodes.
Were can i find who is the developer of this node to ask about this?

Thanks
Rogier

example of the code
[{"id":"ee88398e.83718","type":"ui_text_input","z":"5aa0e86a.ee7558","name":"","label":"","group":"f724151e.4652a","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":182,"y":371,"wires":[["6ec07060.edc2b8"]]},{"id":"6ec07060.edc2b8","type":"function","z":"5aa0e86a.ee7558","name":"","func":"var speak = msg.payload;\nglobal.set (\"speak\", speak);\nreturn msg;","outputs":1,"noerr":0,"x":349,"y":372,"wires":[[]]},{"id":"2840183a.8e6668","type":"function","z":"5aa0e86a.ee7558","name":"","func":"var speak = global.get (\"speak\");\nmsg.payload = speak;\n\nreturn msg;","outputs":1,"noerr":0,"x":347,"y":234,"wires":[["87c1b33d.ee092"]]},{"id":"8134a146.4f1218","type":"ui_button","z":"5aa0e86a.ee7558","name":"nl","group":"f724151e.4652a","order":0,"width":0,"height":0,"label":"button nl","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"str","topic":"","x":171,"y":235,"wires":[["2840183a.8e6668"]]},{"id":"87c1b33d.ee092","type":"play audio","z":"5aa0e86a.ee7558","name":"","voice":"6","x":530,"y":234,"wires":[]},{"id":"e1affb6f.1e5838","type":"play audio","z":"5aa0e86a.ee7558","name":"","voice":"14","x":531,"y":288,"wires":[]},{"id":"d69eb9e2.b075c","type":"function","z":"5aa0e86a.ee7558","name":"","func":"var speaken = global.get (\"speaken\");\nmsg.payload = speaken;\n\nreturn msg;","outputs":1,"noerr":0,"x":348,"y":289,"wires":[["e1affb6f.1e5838"]]},{"id":"8b74077a.8d43f","type":"ui_button","z":"5aa0e86a.ee7558","name":"en","group":"f724151e.4652a","order":0,"width":0,"height":0,"label":"button en","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"str","topic":"","x":172,"y":290,"wires":[["d69eb9e2.b075c"]]},{"id":"e8841e53.2dc7d","type":"ui_text_input","z":"5aa0e86a.ee7558","name":"","label":"","group":"f724151e.4652a","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":182,"y":451,"wires":[["7c0e7817.1835"]]},{"id":"7c0e7817.1835","type":"function","z":"5aa0e86a.ee7558","name":"","func":"var speaken = msg.payload;\nglobal.set (\"speaken\", speaken);\nreturn msg;","outputs":1,"noerr":0,"x":349,"y":452,"wires":[[]]},{"id":"f724151e.4652a","type":"ui_group","z":"","name":"TTS","tab":"48837b3e.4f0524","order":1,"disp":true,"width":"6"},{"id":"48837b3e.4f0524","type":"ui_tab","z":"","name":"TTS","icon":"dashboard","order":2}]


Nick O'Leary

unread,
Sep 23, 2017, 6:05:17 AM9/23/17
to Node-RED

Which module is that node from? node-red-contrib-???

If you search for that on GitHub you should find its repository and info.

Nick


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Roger

unread,
Sep 23, 2017, 4:39:51 PM9/23/17
to Node-RED
mmm cannot find out witch it is...
Any tip to find this out?

Zenofmud

unread,
Sep 23, 2017, 6:25:59 PM9/23/17
to 'Peter Scargill' via Node-RED
do a CD .node-red/node_modules and you can see the nodes you have installed

On Sep 23, 2017, at 4:39 PM, Roger <rog...@qusax.eu> wrote:

mmm cannot find out witch it is...
Any tip to find this out?

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Roger

unread,
Sep 24, 2017, 6:40:38 AM9/24/17
to Node-RED
Finally i use the audio out function node of the dashboard.
This works great!

What i am trying to find out now is to detect when the node finished speaking
Thinking about counting the letters and the this in seconds or so...
Or some one a better solution to detect this?

Niels vd spek

unread,
Oct 1, 2017, 3:31:02 PM10/1/17
to Node-RED
I use this subflow to allow the use of espeak. It has a queue that stores new text while other text is speaking out,

[
    {
        "id": "ab986aee.c0c28",
        "type": "subflow",
        "name": "Speak",
        "info": "",
        "in": [
            {
                "x": 60,
                "y": 80,
                "wires": [
                    {
                        "id": "90dbf0c6.8fac5"
                    }
                ]
            }
        ],
        "out": [],
        "inputLabels": [
            "Text to speak"
        ]
    },
    {
        "id": "8df8c52e.104cb8",
        "type": "exec",
        "z": "ab986aee.c0c28",
        "command": "espeak",
        "addpay": true,
        "append": "",
        "useSpawn": false,
        "name": "",
        "x": 720,
        "y": 80,
        "wires": [
            [
                "c9395ad7.d52018"
            ],
            [],
            []
        ]
    },
    {
        "id": "c6f2f051.aa557",
        "type": "function",
        "z": "ab986aee.c0c28",
        "name": "Simple triggered queue",
        "func": "// if queue doesn't exist, create it\nspeakqueue = global.get('mySpeakQueue') || {queue: [], busy:false};\nspeakqueue.queue = speakqueue.queue || [];\nspeakqueue.busy = speakqueue.busy || false;\nsendmsg = null;\n// if the msg is a trigger one release next message\nif (msg.hasOwnProperty(\"trigger\")) {\n    if (speakqueue.queue.length > 0) {\n        var m = speakqueue.queue.shift();\n        sendmsg = {payload:m};\n    }\n    else {\n        speakqueue.busy = false;\n    }\n}\nelse {\n    if (speakqueue.busy) {\n        // if busy add to queue\n        speakqueue.queue.push(msg.payload);\n    }\n    else {\n        // otherwise we are empty so just pass through and set busy flag\n        speakqueue.busy = true;\n        sendmsg = msg;\n    }\n}\nglobal.set('mySpeakQueue',speakqueue);\nreturn sendmsg;",
        "outputs": 1,
        "noerr": 0,
        "x": 490,
        "y": 80,
        "wires": [
            [
                "8df8c52e.104cb8"
            ]
        ]
    },
    {
        "id": "c9395ad7.d52018",
        "type": "function",
        "z": "ab986aee.c0c28",
        "name": "set trigger",
        "func": "// handle the return from the exec in here \n// if all is good then set msg.trigger property to exist\nmsg.trigger = 1;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 420,
        "y": 180,
        "wires": [
            [
                "bae50b3d.45a2d8"
            ]
        ]
    },
    {
        "id": "bae50b3d.45a2d8",
        "type": "delay",
        "z": "ab986aee.c0c28",
        "name": "pause",
        "pauseType": "delay",
        "timeout": "25",
        "timeoutUnits": "milliseconds",
        "rate": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "x": 650,
        "y": 180,
        "wires": [
            [
                "c6f2f051.aa557"
            ]
        ]
    },
    {
        "id": "90dbf0c6.8fac5",
        "type": "function",
        "z": "ab986aee.c0c28",
        "name": "check payloud",
        "func": "if (typeof msg.payload ===\"string\") {\n    if (msg.payload.charAt(0) != '\"') {\n        msg.payload = '\"'+msg.payload+'\"';\n    }\n   return msg;    \n}\nreturn null;",
        "outputs": 1,
        "noerr": 0,
        "x": 220,
        "y": 80,
        "wires": [
            [
                "c6f2f051.aa557"
            ]
        ]
    },
    {
        "id": "cb09c76a.0baab8",
        "type": "subflow:ab986aee.c0c28",
        "z": "9e23d054.a4a1",
        "x": 1110,
        "y": 460,
        "wires": []
    }
]



Op vrijdag 22 september 2017 22:29:04 UTC+2 schreef Roger:
Reply all
Reply to author
Forward
0 new messages