Page 1 of 2
shell command to change a tts engine?
Posted: 01 Aug 2017 06:24
by liloli
Hi everyone~
could anyone tell me the shell command to change the default tts engine? I like to change it through "execute root command".
thanks a lot~
Re: shell command to change a tts engine?
Posted: 01 Aug 2017 10:36
by Desmanto
First you wanna set the default TTS engine to the ones you need, from the Settings - Text to Speech output at your phone. You need the value later. For example you use Ava and wanna change to Tom and vice versa.
You can change the default TTS using Action Set System Setting. Select Category Secure and find tts_default_locale. Press save and copy that element, so you have the first action to set it to Ava. Next, change the TTS setting again to the other voice that you want, example to Tom. Go back to automagic, open the second action, and tap the tts_default_locale again. You will see the value change to reflects Tom TTS. Save it and tap "This Usage" at the prompt.
Now you have two seperate actions to set your default TTS to Ava and Tom. Put it anywhere you need in the flow. Remember to check the "I have verified the setting" option to make it executeable.
If you still prefer to run in from execute root command, you can change the value of settings database. Use this command
Code: Select all
settings put secure tts_default_locale {value of the TTS engine}
For example, for Ava voices at my phone, it appears as "vocalizer_e2.tts:en_US_Ava". Find and copy this value using the Action Set System Setting above. Or since you have root, you can also use SQLite Editor to open
Settings Storage - settings.db - secure - tts_default_locale.
So the command will be :
Code: Select all
settings put secure tts_default_locale vocalizer_e2.tts:en_US_Ava
Re: shell command to change a tts engine?
Posted: 01 Aug 2017 12:24
by liloli
thanks for the reply.
Sorry to say that there is no "Settings - Text to Speech output", and I couldn't find the "Settings - Text to Speech output" from Set System Setting.
Is there another way?
Re: shell command to change a tts engine?
Posted: 01 Aug 2017 12:33
by Desmanto
I am sorry if I am quite ambiguous. I mean the usual settings at your phone, not in automagic action.
Open settings at your phone, Language & Input - Text-to-speech output. The position might be different in some phones, you gotta to find it out.
Sometimes it is located at the accessibility or maybe in the more settings.
Or you can use automagic shortcut too. Use action Launch App, choose package name for Settings (com.android.settings) and for the class name, find "text", you should have the text-to-speech already, choose it.
Execute it, you will be landed directly at the TTS setting, to pick the default TTS engine.
Re: shell command to change a tts engine?
Posted: 01 Aug 2017 12:54
by liloli
You explained to me very clearly
.
Just it was said that tts is locked in my cellphone. I tried every step above.
And the launch "com.android.settings" ---- "com.android.setttings.tts.TextToSpeechSet" failed. I know there should be a window popup for me to choose tts engine. but there is not. sorry.
In fact , after I execute the flow, the window seems flash a tiny little bit, then it returns to the automagic window(I run the flow manually).
Re: shell command to change a tts engine?
Posted: 01 Aug 2017 13:44
by Desmanto
What phone do you have? I never see any reason TTS should be locked. If it is really locked out, probably it is set somewhere in the build.prop, using special parameter. That will be beyond the topic discussed in this forum.
You install 3rd party TTS to see if it can worked. I use vocalizer e2. But there are a lot of alternatives to try out.
Re: shell command to change a tts engine?
Posted: 01 Aug 2017 13:51
by liloli
Maybe I didn't say it right, I mean the switch of default tts engine is locked. I installed another engine. It will be working good only in its own app. There is no way I can make that the default engine.
some days before, google tts engine was working on my phone. after I accidentally uninstall it, it won't work even if I reinstall it. so weird.
Re: shell command to change a tts engine?
Posted: 01 Aug 2017 14:04
by Desmanto
If you check the database secure tts_default_locale, what is the value? After you install new TTS engine, do this value change?
If you use action Speech Output, what are the choices of voice to choose from? If you only need to use the engine, there is no need to make it default TTS.
I use various of language with Speech Output and no need to change the default one.
Re: shell command to change a tts engine?
Posted: 01 Aug 2017 14:27
by liloli
I want to change default engine because there is no MY lanuage in current list of speech out. How should I check the database you mentioned?
the only tts engine left is PICO tts which is the system default one.
Re: shell command to change a tts engine?
Posted: 01 Aug 2017 14:32
by liloli
I just tried init system setting variable, I got null.