Text to speech does not work in Android 4.2 Jelly Bean

We added voice guidance to our application using the text-to-speech API a couple of years ago, and it works well. We recently started receiving emails from users who upgraded to Android 4.2 Jelly Bean, saying that the voice prompts did not work and that they received a message that there was no voice data and they needed to download it. When they click to download, they are given the option to download languages ​​other than English.

We introduced the text after this post on the Android Developers Blog. We call the TextToSpeech.Engine.ACTION_CHECK_TTS_DATA intent, and if anything other than TextToSpeech.Engine.CHECK_VOICE_DATA_PASS , we call the TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA intent.

We do not have access to a device running 4.2. Today I went to the local store and downloaded the application to the Nexus 7 tablet with 4.2 installed and was able to reproduce the problem. However, when we create an AVD based on Nexus 7 and run the emulator, the voice prompts work fine and we cannot reproduce the problem.

+6
source share
3 answers

Checking TTS with Android OS4.1 and OS 4.2, polite, is different.

OS 4.1 does not properly handle intent to install data *

TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA

OS 4.2 does not properly handle intent to verify voice data *

TextToSpeech.Engine.ACTION_CHECK_TTS_DATA

* By this, I mean that it does not return the correct status codes in accordance with the old versions. For example, CHECK_TTS_DATA returns CHECK_VOICE_DATA_MISSING_DATA when it has explicitly set voice data. It is possible that there is some other evidence of intent that needs to be conveyed now, but I'm not sure where this is documented.

In my applications, I had to disable these checks for newer versions of the OS. I suspect that Google may have done this because their terms for using Android now have a TTS mandate (but I can’t confirm this - I’m sure that there is a site that describes what exactly needs to be implemented in order to be named "Android")

Update

As I expected, Android OS 4.1 now requires the inclusion of text into speech on each Android device, so the checks are now somewhat redundant. From this link: Android 4.1 Compatibility Definition

3.11 Text to Speech
Android 4.1 includes APIs that allow applications to use text-to-speech (TTS) services and allows service providers to provide TTS services [Resources, 32]. Device implementations MUST meet these requirements for the Android TTS platform:

  • Device implementations MUST support the Android TTS APIs and MUST include a TTS engine that supports the languages ​​available on the device. Please note that open source Android open source software includes a fully functional implementation of the TTS engine.
  • Device implementations MUST support the installation of third-party TTS engines.
  • Device implementations MUST provide a user interface that allows users to select a TTS engine for use at the system level.
+7
source

I suggest seeing the demo code below. i will help u.

 http://code.google.com/p/simple-jellybean-tts-example/ 

and

Cm

 http://developer.android.com/reference/android/speech/tts/TextToSpeech.Engine.html#KEY_FEATURE_NETWORK_SYNTHESIS 

and

 http://developer.android.com/reference/android/speech/tts/TextToSpeech.html#speak(java.lang.String,int,java.util.HashMap) 

- Jatin

0
source

All Articles