3

I have to override text-to-speech settings of the device programmatically in android, how to do so?

Complete use case is: My application is setting the app language based on the user's input i.e: if user selects French as language then App will display all text and announce text in french only.BUT problem is in device's TTS engine setting You can override application settings using option "Always use my settings" check box, so is there any way to check or uncheck the checkbox programmatically through my application, so what i need to do from app is when app is going to announce the text , before announcing it will uncheck the check box and then announce it and again will chek the checkbox back.

By the way I am developing app using android 2.1 version and using Samsung Galaxy tab.

Please provide some way to achieve it.

Regards, Piks

piks
  • 1,621
  • 8
  • 32
  • 59
  • It looks like what you're looking for [isn't possible](http://stackoverflow.com/questions/6656536/setting-language-for-tts-programmatically#comment8479748_6656805). – an00b Jul 18 '12 at 23:15

2 Answers2

1

You don't have to change system settings, you just need to call setLanguage() and maybe setEngineByPackageName() on your TTS instance. Generally, you can't change system settings from an app, that goes for TTS as well.

Nikolay Elenkov
  • 52,576
  • 10
  • 84
  • 84
  • There seems to be a lot of demand for overriding the ["Always Use my Settings"](http://stackoverflow.com/q/10960155/636571) checkbox. [This comment](http://stackoverflow.com/questions/6656536/setting-language-for-tts-programmatically#comment8479748_6656805) suggests that it **isn't possible** to override that system setting. Which makes sense, because otherwise it defeats the purpose of "always use **my** settings". Can you confirm this? +1 for now. – an00b Jul 18 '12 at 23:13
  • 1
    You'll have to check the source code to confirm, but since it's a system setting I don't think you can override it. BTW it seems this is gone in Jelly Bean. – Nikolay Elenkov Jul 19 '12 at 01:15
  • Yes, I noticed this setting has gone in ICS as well (Samsung Galaxy Nexus running Android 4.0.4). BTW, any idea [how to tell whether a specific TTS engine is checked (enabled)](http://stackoverflow.com/q/12074981) in FROYO **2.2**? – an00b Aug 23 '12 at 01:53
1

You can't override device settings as far as TTS speed is concerned, which is ridiculous, Default 'normal' is rather too fast and 'slow' is too slow... if we had sliding adjustments, as in TTS apps, then there would be no problem.

cay
  • 11
  • 1
  • 1
    TTS engine settings have one check box option "Always use my settings", I just want to check/enable - unchecked/disable it when my application will announce and after completion of announce again restore the previous value...i would just like to know whether it is possible to change from my application or not.Please share your opinion regarding this. – piks Jun 11 '12 at 04:29