Reply To: google translate TTS link wird nicht abgespielt

Max2Play Home Forums Max2Play as Squeezebox (Player / Server) google translate TTS link wird nicht abgespielt Reply To: google translate TTS link wird nicht abgespielt

16. Februar 2016 at 17:23 #18525

Hi azr,

manually running http://translate.google.com/translate_tts?ie=UTF-8&tl=de&q=zefix+noch+eins.&client=tw-ob in a browser works, but a call by a machine (Squeezebox Server) might be interrupted by Googles abuse system as stated here: http://stackoverflow.com/questions/9893175/google-text-to-speech-api

What you can do as a workaround:
– install your own Text-to-speech software on the raspberry (e.g. espeak) with
apt-get update && apt-get install espeak

– generate WAV-Files by calling the text-to-speech-engine the following way and save to your media-path

/usr/bin/espeak "zefix+noch+eins" -w /media/yourtext.wav
# get more infos with: espeak --help
# set language, voice, speed and more...

– make sure the Squeezebox Server is not trying to convert the files: deactivate flac and mp3 in Squeezebox-Server Settings -> Advanced -> File types -> WAV (I had to do this, otherwise it did not play sound)

– test and play the generated file

You may also create your own HTTP-service that acts the same way like the Google TTS Engine and creates the WAV-file. You could do this by creating a Max2Play-Addon that takes the words as HTTP-GET Parameter, runs espeak and generates the WAV-File in the background and sends it as result of the HTTP-Call (if the file already exists it would just send it). The Addon should also have a installer for espeak and a basic set up (default language, voice, reading speed).

Maybe anyone likes to implement this feature? I could help you with special questions. There might be others waiting for this one 🙂

Stefan