Raspberry Pi Speech Synthesis

I created a basic speech synthesis web service (for pi or other capable linux platforms) with a ST device type supporting capability.speechSynthesis

I built this mainly for my own use, so documentation is a little rough still.

  1. Install ESPeakWeb on your pi or other linux system: https://github.com/shikkie/ESpeakWeb

There is a test page that uses jQuery to perform the HTTP POST needed to test.

  1. Add the deviceType to your device types.

  2. Add a device in the IDE. Configure it with the ip, port, and path.

The difference between this and Sonos or VLC Thing is that it doesn’t route the text to speech to the cloud, so it’s faster (with a somewhat more robotic voice).

I haven’t had success using the IDE simulator with the device type, but it does work with my Pi 2 and a Debian machine.


Hi @shikkie I like your solution since it doesn’t involve a hop through the cloud in order to push a sound alert. But I’m having trouble getting it to work via SmartThings.

I setup a Raspberry Pi in the way you describe, and the espeak web interface seems to work as intended (i.e. I hear the sound on my RPi when I enter text in a web browser on another device).

Next I made a new device type with the code you wrote. I can see the device in my SmartThings app and configure it with IP address, port and path. But if I try to send a test tts nothing happens. Similarly, if I use the SmartApp you wrote to send a sound on a door sensor opening, I don’t hear anything on my RPi.

Any thoughts on how I can troubleshoot this? Thanks!

Awesome. This is very similar to a solution I’m working up. Any updates? Did it work?

When I had that issue trying to send a text-to-speech alert with @shikkie’s smart app, and didn’t hear back, I kinda put the whole thing on hold. I don’t really know anything about groovy (or other programming languages), so I’m afraid I’ve kinda hit a dead end. I’d love to hear about what you’re working on, if you don’t mind sharing.

I just finished my project. Well, I’m not completely finished. I’ll probably never be finished, but I finished it enough to share it.

1 Like

Cool thanks for sharing! I’m out of town on vacation but will see if I can get it working when I get home.

This code works well to access php server on pi. I modified it to give me several different commands so that I can choose what it says with each door opening. I ended up using Google Translate TTS as it sounds much better than any on Pi options.

Also, I modified the “tones” to play a random song on the pi from a list of MP3 that I can update via Samba file share.

Now I just need to come up with a smart app to play the tone when the doorbell button is pushed and assign a TTS command to each door sensor.

I thought I read somewhere that Google discontinued their TTS. Please elaborate on how you implemented the Google TTS as I would like to use this as well.

I am using Dan Fountain’s script .

Works great!