vilicvane / cordova-plugin-tts

Cordova Text-to-Speech Plugin (Maintainer WANTED!)
177 stars 138 forks source link

TTS ERR_UNKNOWN on Android #106

Closed rcpinheiro closed 4 years ago

rcpinheiro commented 4 years ago

Hi! I've made an Android app that uses this plugin and it's been working for more than a year. Suddenly, it stopped working with the error TTS ERR_UNKNOWN. I know if not's a bug in the source code since the last build was 7 months ago and the problem only showed up in the last few days. Anyone else with this problem?

orlyapps commented 4 years ago

Got the same problem.

rcpinheiro commented 4 years ago

It seems the problem is that TTS now is only working for english language. These work:

TTS.speak('test')
TTS.speak({ text: 'test', locale: 'en-US'})

This doesn't: TTS.speak({ text: 'test', locale: 'pt-BR'})

rcpinheiro commented 4 years ago

Found a solution after checking the logcat:

10-23 18:39:22.815 4685 5435 E TTS.ControllerWrapper: java.io.FileNotFoundException: /data/user_de/0/com.google.android.tts/files/superpacks/pt-pt/pt-pt-x-jfb-r6/pipeline (No such file or directory)

This means the language dictionary isn't installed. What I did to fix:

  1. go to Google Text-to Speech in Settings
  2. Install Voice Data
  3. delete and download again the required language
  4. test voices (important!). In my case there are 4 voices but only two work , the other give a "Failed synthesizing voice" error.