4

Is it possible with the help of intent to open the settings window speech synthesizer google, namely, the choice of male or female voices "English (UK)"? image settings TTS

I need to get it right in the settings select the voice for the UK, but not in the general settings TTS Pro com.android.settings.TTS_SETTINGS I know I do not fit.

At the moment I have the following code:

<Preference
                android:summary="@string/pref_gender_voice_summary"
                android:title="@string/pref_gender_voice_title">
                <intent android:action="com.android.settings.TTS_SETTINGS"></intent>
            </Preference>

Forgive me for using Google translator

  • 2
    Possible duplicate of [how to show up the settings for text to speech in my app?](http://stackoverflow.com/questions/3160447/how-to-show-up-the-settings-for-text-to-speech-in-my-app) – EJK Jan 07 '16 at 14:42

2 Answers2

4

It is not possible to choose a male or female voice from the system settings. Voices in the TTS engine are named with roman numerals: Voice I, Voice II, ...

Open voice settings by referencing its package name and action "install tts data".

// launch voice settings
Intent intent = new Intent();
intent.setPackage("com.google.android.tts");
intent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
apsommer
  • 586
  • 1
  • 9
  • 18
3

Yes.

    Intent intent = new Intent();

    intent.setAction("com.android.settings.TTS_SETTINGS");
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    startActivity(intent);
Kris Krause
  • 7,304
  • 2
  • 23
  • 26
  • 1
    Thanks for the answer, but I need to get it right in the settings select the voice for the UK, but not in the general settings TTS Pro com.android.settings.TTS_SETTINGS I know I do not fit – Максим Фомичёв Jan 07 '16 at 14:53
  • I have noticed that different devices "respond" to "com.android.settings.TTS_SETTINGS" differently. – Kris Krause Jan 18 '16 at 16:14