Text to Speech not working in Android 4.2 Jelly Bean

后端 未结 3 743
囚心锁ツ
囚心锁ツ 2021-02-09 16:41

We added voice prompts to our app using the Text to Speech API a couple years ago and it has been working well. Recently, we started receiving email from users that upgraded to

相关标签:
3条回答
  • 2021-02-09 16:57

    direct link for code

    google project hosting

    link code

    http://simple-jellybean-tts-example.googlecode.com/svn/trunk/%20simple-jellybean-tts-example/Sandbox/

    0 讨论(0)
  • 2021-02-09 16:58

    i suggest to see below code demo. i will help u.

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

    and

    See

    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 讨论(0)
  • 2021-02-09 17:11

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

    OS 4.1 does not correctly handle the intent to install data*

    TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA

    OS 4.2 does not correctly handle the intent to check for voice data*

    TextToSpeech.Engine.ACTION_CHECK_TTS_DATA

    * By this I mean that it doesn't return the correct status codes as per the old versions. For example, CHECK_TTS_DATA returns CHECK_VOICE_DATA_MISSING_DATA when it clearly does have voice data installed. It's possible that there is some other intent data that now needs to be passed, but I'm not sure where this is documented.

    In my apps I have had to disable these checks for newer OS versions. I suspect Google may have done this because their terms to use Android now mandate TTS (but I can't verify this - I'm sure there's a site out there that describes exactly what must be implemented to be called 'Android')

    Update

    As I suspected, Android OS 4.1 now mandates Text-to-Speech be included in every Android device, thus 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 make use of text-to-speech (TTS) services, and allows service providers to provide implementations of TTS services [Resources, 32]. Device implementations MUST meet these requirements related to the Android TTS framework:

    • Device implementations MUST support the Android TTS framework APIs and SHOULD include a TTS engine supporting the languages available on the device. Note that the upstream Android open source software includes a full-featured TTS engine implementation.
    • Device implementations MUST support installation of third-party TTS engines.
    • Device implementations MUST provide a user-accessible interface that allows users to select a TTS engine for use at the system level.

    0 讨论(0)
提交回复
热议问题