文本到语音不工作的Andr​​oid 4.2果冻豆 [英] Text to Speech not working in Android 4.2 Jelly Bean

查看:124
本文介绍了文本到语音不工作的Andr​​oid 4.2果冻豆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们添加使用文本到语音的API语音提示我们的应用程序几年前,它一直运作良好。最近,我们开始从升级到Android 4.2果冻豆说,语音提示都没有工作,他们获得的语音数据丢失的消息,他们需要下载它的用户接收电子邮件。当他们点击下载给他们下载非英语语言的选择。

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 Android 4.2 Jelly Bean saying that voice prompts are not working and that they are getting a message that the voice data is missing and they need to download it. When they click to download they are given the option of downloading languages other than English.

我们跟随这交在Android开发者博客。我们调用的 TextToSpeech.Engine.ACTION_CHECK_TTS_DATA 意图,如果返回任何比 TextToSpeech.Engine.CHECK_VOICE_DATA_PASS 等我们引用在 TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA 意图。

We implemented text to speech following this post on the Android Developer's Blog. We are invoking the TextToSpeech.Engine.ACTION_CHECK_TTS_DATA intent and if anything other than TextToSpeech.Engine.CHECK_VOICE_DATA_PASS is returned we invoke the TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA intent.

我们不必访问运行4.2的装置。今天我去到当地的商店,并下载了一台Nexus 7平板电脑4.2安装应用程序,并能重现该问题。然而,当我们创建一个AVD的基础上的Nexus 7和运行仿真器的语音提示做工精细,我们无法重现该问题。

We don't have access to a device running 4.2. I went into a local store today and downloaded the app on a Nexus 7 tablet with 4.2 installed and was able to reproduce the problem. However, when we create an AVD based on the Nexus 7 and run the emulator the voice prompts work fine and we are not able to reproduce the issue.

推荐答案

TTS采用Android OS4.1检查和OS 4.2,礼貌,不同的。

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

OS 4.1不能正确处理的意图安装数据*

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

TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA

OS 4.2不能正确处理的意图来检查语音数据*

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

TextToSpeech.Engine.ACTION_CHECK_TTS_DATA

* 的我的意思是,它并不能返回正确的状态codeS按照旧版本。例如,CHECK_TTS_DATA返回 CHECK_VOICE_DATA_MISSING_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.

在我的应用我不得不禁用这些检查较新版本的操作系统。我怀疑谷歌可能已经做到了这一点,因为他们的条件使用Android现在强制TTS(但我无法验证这一点 - 我敢肯定有一个网站在那里,说明什么必须实现被称为机器人)

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')

更新

正如我怀疑,Android操作系统4.1,现在责成文本到语音转换被包括在每一个Android设备,这样的检查是现在有些多余。从这个链接:<一href="http://static.googleusercontent.com/external_content/untrusted_dlcp/source.android.com/en//compatibility/4.1/android-4.1-cdd.pdf"相对=nofollow>的Andr​​oid 4.1兼容性定义

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文本到语音转换
  安卓4.1包含的API,允许应用程序使用文本到语音转换(TTS)服务,并允许服务供应商提供的TTS服务[资源,32]实现。设备实现必须满足这些要求涉及到Android TTS框架:

  •   设备实现必须支持Android TTS框架的API,并应包括TTS引擎支持设备上可用的语言。需要注意的是上游的Andr​​oid开源软件包括一个全功能的TTS引擎实现。
  •   设备实现必须支持安装第三方TTS引擎。
  •   设备实现必须提供用户访问界面,允许用户选择TTS引擎使用在系统级。
  • 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.

    这篇关于文本到语音不工作的Andr​​oid 4.2果冻豆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆