Thread: [SailfishOS] [Announce] Poor Maps
View Single Post
Posts: 805 | Thanked: 2,861 times | Joined on Apr 2012
Originally Posted by otsaloma View Post
Text to speech? To my knowledge, there's no such thing in the Sailfish platform. I once tried espeak, which someone had packaged and distributed at OpenRepos. On about the fifth call, it crashed the whole OS, so it didn't seem ready for use. It would be fairly easy for me to add TTS calls to navigation, finding a working TTS library/program is the difficult part.
The issue with espeak, as currently packaged, is that it crashes while trying to output to a sound device. In Saera, I work around this by having espeak write to STDOUT instead, and piping that to gstreamer. This can be done via:

espeak --stdout "Some text" | gst-launch-1.0 -q fdsrc ! wavparse ! audioconvert ! pulsesink
A similar approach can be used with flite. The main issue with flite is that it cannot output to STDOUT - or, for that matter, any pipe, due to how it interacts with file handlers - but it can write to a file; so my approach here is to have flite save to a file and then have gstreamer play that file. Command line for this is:

flite -t "Some text" -o /tmp/out.wav && gst-launch-1.0 -q filesrc location=/tmp/out.wav ! wavparse ! pulsesink
Finally, I would like to mention that for anyone looking for a TTS-enabled GPS solution on SFOS, there is one in development in Saera (and should be released soon).

The Following 12 Users Say Thank You to taixzo For This Useful Post: