How to Programmatically Change TTS Default Engine

an00b picture an00b · Sep 9, 2011 · Viewed 10.4k times · Source

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?

Answer

Ishaan picture Ishaan · May 29, 2016

The above answer is no longer valid as the method is deprecated. Android API 14 and above you need to use the constructor for setting the engine.

TextToSpeech(Context context, TextToSpeech.OnInitListener listener, String engine)

The "engine" String is the package name of the TTS engine you want to use.