如何Programmtically更改TTS的默认引擎引擎、Programmtically、TTS

由网友(随你沧桑)分享简介:在除了微微TTS引擎,配备了Android的,我已经安装了其他TTS引擎。我可以改变这是由系统默认 - 手动:In addition to the Pico TTS engine that comes with Android, I have another TTS engine installed. I can c...

在除了微微TTS引擎,配备了Android的,我已经安装了其他TTS引擎。我可以改变这是由系统默认 - 手动:

In addition to the Pico TTS engine that comes with Android, I have another TTS engine installed. I can change which is the default used by the system -- manually:

Settings > Voice input & output > Text-to-speech settings > Default Engine

我想是能够做到这一点的编程,从我的应用程序。这可能吗?

I would like to be able to do that programmatically, from within my application. Is this possible?

如果这样,我将如何去的?

If so, how would I go about that?

推荐答案

您不能更改默认引擎。通过调用TextToSpeech.setEngineByPackageName() (自2.2)或使用需要一个引擎包参数的构造函数(在ICS可用,所以不是真的有用现在)。

You can't change the default engine. You can however, change the engine you are using by calling TextToSpeech.setEngineByPackageName() (available since 2.2) or use the constructor that takes an engine package parameter (available in ICS, so not really useful right now).

也没有API之前ICS找出安装了哪些引擎,所以你需要事先知道其他引擎的封装,以便能够使用它。

There is also no API before ICS to find out what engines are installed, so you need to know the other engine's package beforehand to be able to use it.

阅读全文

相关推荐

最新文章