Node "Play Audio" and "Text-to-Speech" on a Raspberry Pi

Just for information for others who want to use this on older Pi hardware

If you go thru normal installation process and end up with an error showing in the pico2wave node - you'll need to compile it.

Unfortunately, the compilations instructions don't quite work and you need to install further dependencies

So before following the compilation instructions do this (this is from going back thru my bash history so I hope I haven't missed anything off!)

sudo apt-get install autotools-dev
sudo apt-get install libtool
sudo apt-get install libpopt-dev

I then git cloned the repository so that I had a new folder
/home/pi/picotts
and then cd to pico and ran the compile instructions from there

Unfortunately, the last of the instructions on the GitHub site say
make install
but this didn't work for me
neither did
sudo make install
(The sudo one appears to do the job but I still got an illegal instruction error if i ran pico2wave)

However, there is a working pico2wave in /home/pi/picotts/pico

At this point, my Linux skills ran out so to make the node use the new compiled version I manually edited
/home/pi/.node-red/node-modules/node-red-contrib-pico2wave/pico2wave.js

and replaced line 65
node.pico2waveCommand = "pico2wave -w " + node.filePath + " -l " + node.language;
with

node.pico2waveCommand = "/home/pi/picotts/pico/pico2wave -w " + node.filePath + " -l " + node.language;

and restarted Node-RED and it all worked

It was a LOT of faffing around but it lets me use an old Pi to act as a standalone text to speech device to issue commands to my Alexa dot :slight_smile:

image

Note on how to hear it when running Node-RED as a service