Offline TTS Options - Raspberry Pi

I am nearing the end development stages of a boat-based NR system running on a Pi and accessed with an Android-based tablet browser.

The system uses audio alerts and I have two choices, either creating lots of MP3 files for selective play-out or using TTS, with the latter being the most tidy and very flexible.

My question is generally about TTS voice options. Developing on a Windows machine rather spoils me for choice when looking for UK English female voices. However my operational platform is a Raspberry Pi and opening the Dashboard locally only offers a single voice option.

Whilst I'm sure the lady is jolly nice she is a little laid back for the warning alerts I am seeking. "Caution Low Bridge Ahead" is so comforting it almost makes me want to drift into it, yet the MS options are more assertive.

My questions are:

  • Is TTS processed offline? [ My locations will be far away from any internet service]

  • When viewing the Pi-served dashboard with an Android-based tablet browser, is the TTS processed on the Pi or the tablet? Is it the tablet or the Pi that is offering the single voice option?

  • Is it possible to download different voice libraries?

Any pointers will be greatly appreciated.

Hi @NPT.

SpeechSynthesis Which is what creates the Speech, is an agreed standard API for UA's much like the canvas API is.

When UA's need to use this API, I believe the OS has its own implementation of Voices, which is then passed to the API for use.

I'm sure it is possible to install other voices, but its not anything the browser will care about - the browser will just use the speech profile it has been passed by the OS.

Therefore, If the OS supports the ability to use 'other' Speech Profiles (that are not packaged with the OS) - so would a UA running on it.

I don't have much experience with this API - but hopefully, this should steer you in the right direction.

lastly - its offline (I believe)

Many thanks for that.

I have had a brief look and think it might need some serious thought later today. I shall keep digging for offline options. There is also Festival which I have just stumbled across.

Stop press: I have just discovered that the Play audio node has a serious limitation " To work the editor web page must be open." and indeed it only works under those circumstances, so another node to delete..... Perhaps it would be easier to find a node that plays out an .mp3 file.

Sorry I might have confused things with uncommon terminology.

UA - User Agent/Browser.

The Audio Node does NOT need the internet, so in that respect it is offline.

The voices are generated by the browser/UA, and NOT the server that is actually providing the dashboard.

And the voice selection is whatever is available / installed on the OS that is running browser

On a Pi, you can always do that in the background via a command line and the exec node.

This is on standard Debian PC rather than a Pi but the principals are the same:


[{"id":"626d37e4256e310d","type":"group","z":"4a3fcf357a20bf56","name":"Server Sounds \\n ","style":{"label":true},"nodes":["c360ce2a0183b10e","6f48f521352afcc4","347583e6184bc379","80ecb8a8c9bcb479"],"x":114,"y":1215.5,"w":352,"h":193},{"id":"c360ce2a0183b10e","type":"inject","z":"4a3fcf357a20bf56","g":"626d37e4256e310d","name":"Dave","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Look Dave, I can see you're really upset about this.","payloadType":"str","x":210,"y":1280,"wires":[["6f48f521352afcc4"]]},{"id":"6f48f521352afcc4","type":"exec","z":"4a3fcf357a20bf56","g":"626d37e4256e310d","command":"pico2wave -l en-GB -w lookdave.wav \"","addpay":"payload","append":"\" && aplay lookdave.wav && rm lookdave.wav","useSpawn":"false","timer":"","winHide":true,"oldrc":false,"name":"pico2wave","x":370,"y":1280,"wires":[[],[],[]],"info":"Need to install Pico TTS using:\r\n\r\n```\r\nsudo apt install libttspico-utils\r\n```\r\n\r\nMust have at least ALSA installed\r\nand configured."},{"id":"347583e6184bc379","type":"inject","z":"4a3fcf357a20bf56","g":"626d37e4256e310d","name":"Left","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"/usr/share/sounds/alsa/Side_Left.wav","payloadType":"str","x":210,"y":1360,"wires":[["80ecb8a8c9bcb479"]]},{"id":"80ecb8a8c9bcb479","type":"exec","z":"4a3fcf357a20bf56","g":"626d37e4256e310d","command":"aplay","addpay":"payload","append":"","useSpawn":"false","timer":"","winHide":true,"oldrc":false,"name":"","x":350,"y":1360,"wires":[[],[],[]],"info":"Must have at least ALSA installed\r\nand configured."}]

The first one is text-to-speech. The second is a wav file.

Thanks for that - all food for thought!

I've successfully managed to get sound out of the remote browser [tablet] using the Cloud-based TTS and am now looking for local alternatives.

I'm currently fiddling with node-red-contrib-play-soundfile node - which sees and plays out an .mp3 file stored in the Pi but no audio from anywhere, which is a bit odd. So much to learn!

The Pi can be fun and games to make sure the audio goes to HDMI or the audio jack or…

It certainly seems that way!

I have TTS working out of the tablet [ browser accessing NR running on a Pi over local WLAN ] beautifully.

I didn't realise it was such a struggle to simply play out an audio file instead. Onwards and downwards.... :slightly_smiling_face:

I've always had issues with Linux sound. ALSA, etc seems to be a black art. For me it rarely works straight off and requires lots of messing with incomprehensible settings randomly until something happens. As often or not, it doesn't work.

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