如何Programmtically更改TTS的默认引擎 [英] How to Programmtically Change TTS Default Engine

查看:433
本文介绍了如何Programmtically更改TTS的默认引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在除了微微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?

推荐答案

您不能更改默认引擎。通过调用<一个但是,您可以更改所使用的引擎href="http://developer.android.com/reference/android/speech/tts/TextToSpeech.html#setEngineByPackageName%28java.lang.String%29">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.

这篇关于如何Programmtically更改TTS的默认引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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