0

I'm using Google TTS library in android app... Everythnig works perfectly... But problem is some android device have Pico TTS. Moreover, language that I use should be downloaded...

So my question, is there a way to use Android Google TTS engine as external library, Is there support library?... is this open source project?

If it is, how to do that?

I'm asking this question, because some devices only support pico tts...so external library will solve problem...

Ucdemir
  • 2,852
  • 2
  • 26
  • 44

1 Answers1

1

This is an old question. The last recent solution, and the most effective is

curl 'https://translate.google.com/translate_tts?ie=UTF-8&q=hello&tl=en&tk=995126.592330&client=t' -H 'user-agent: stagefright/1.2 (Linux;Android 5.0)' -H 'referer: https://translate.google.com/' > google_tts.mp3

and it is largely discussed here.

This solution (that may break in future), is implemented in the python library gTTS, that wraps the api in a useful way, so you can specificy the language, the text and write ou the file easily:

>> from gtts import gTTS
>> from tempfile import TemporaryFile
>> tts = gTTS(text='Hello', lang='en')
>> f = TemporaryFile()
>> tts.write_to_fp(f)
>> f.close()

NOTE. If we consider the opposite: Speech to Text, recently Google has released the Cloud Speech API that makes use of Machine Learning, it supports more languages, and it's the official api for speech recognition.

By the way, today there are a lot of other platforms doing this, and probably better that the TTS web service. Microsoft has a Speech API as part of their new cognitive systems, and it's free up to 5000 queries/month. IBM Watson Text To Speech API is extremely powerful and recently introduced Expressive Synthesis that is how to synthesize emotions in the voice. All these cloud api uses https://www.w3.org/TR/speech-synthesis/ as markup language to define the text to speech, that is far much more expressive than using simple unlabeled text.

Community
  • 1
  • 1
loretoparisi
  • 15,724
  • 11
  • 102
  • 146
  • is my shared link use same method? https://github.com/kewang/google-tts/blob/master/src/tw/kewang/google/tts/GoogleTTS.java – Ucdemir Apr 16 '16 at 19:50
  • 1
    Since it defines `private static final String TRANSLATION_URL = "http://translate.google.com/translate_tts?tl=%s&q=%s&ie=UTF-8"; ` as endpoint, definitively yes, this is a java wrapper around the google tts web service. I have updated the answer, with more powerful solutions btw. – loretoparisi Apr 16 '16 at 19:54
  • I have Columnist app, tts should be unlimited and free..do they? – Ucdemir Apr 16 '16 at 19:58
  • uhm as you mentioned this is up to the user like downloading voices etc. If you look at the stackoverflow link I mention, there are some free solutions, with few options but free (like few languages). I guess a free unlimited solution that does not rely on the host OS system i.e. a tts api of this kind, free of charge a with complete language support does not exists. – loretoparisi Apr 16 '16 at 20:04