Site icon Geeknizer

Google’s Text to Speech API

Google had introduced upgrades to it’s translate service by adding a provision to Speak out loud the translated text. If you haven’t tried it so far, give it a shot here.

There’s no official API for the text-to-speech service. But while playing around with the web interface, I found that anyone can  get access to  the service. Basically, what Google is taking a plain HTTP GET (REST) based request and returning the audio in MP3 format, The Request URL : http://translate.google.com/translate_tts?tl=en&q=some+text

How to Use it: It’s easy, put some REST based Text in the above URL, and you`ll get a MP3 back. http://translate.google.com/translate_tts?q=This+is+a+good+hack

This can be integrated into different AJAX based widgets to read out the text.

Limitations: All this being unofficial, comes with a limitation. First one: It’s English only, and second, I couldn’t get it to convert text larger than 100 characters. But that can be taken care of by splitting the text into multiple 100 char chunks and then calling the REST API everytime. I made a dummy script, read 1000+ characters with a charm. Make use of it before Google plans to remove it.

Exit mobile version