Closed eyedean closed 1 day ago
Thank you for your request!
Choosing Google should switch to Google TTS Engine.
The OS is responsible for this. The plugin only opens this modal. For this reason i am closing this issue.
Feel free to create a PR for #88.
Thank you for your response, @robingenz, and I respect your decision.
I still believe that the way this plugin creates the tts
object (in the constructor or plugin load time, before popping the modal via openInstall
) is not dynamic enough to update itself after the User has chosen a different engine.
Now, your theory is that it's on the OS. And, once the user makes a decision, the OS should update all the new android.speech.tts.TextToSpeech(...)
instances (with no fixed engine) to point to this engine. I don't think that's quite true, though -- the user's choice is only for one action (one speak) and not for all the flying tts
objects. So, I believe there must be a way in the plugin to tie this tts
object to that user response!
I understand that this request is not a common case, and there are definitely higher-priority items to focus on in an open-source package. So, I will not continue this discussion unless I bring in a PR. :)
Thank you again for your dedication and help!
I still believe that the way this plugin creates the tts object (in the constructor or plugin load time, before popping the modal via openInstall) is not dynamic enough to update itself after the User has chosen a different engine.
You're right. Now I understand what you mean. I added a new initialize()
method which can be called to update the TTS instance. Please give this dev build a try and let me know if your issue is resolve:
npm i @capacitor-community/text-to-speech@4.0.1-dev.1d4e158.1717578191
It looks like there hasn't been a reply in 30 days, so I'm closing this issue.
Plugin version: I am on a fork version of an old version (limitation on Capacitor Upgrade), but I am afraid it happens everywhere.
Platform(s): Android
Current behavior: On Samsung devices, when
openInstall()
is called a pop-up appears to select the Engine ("Continue using ...") between Samsung's TTS and Google's TTS.Choosing Google doesn't do anything.
Expected behavior: Choosing Google should switch to Google TTS Engine.
Steps to reproduce:
openInstall()
Related code: The only way I could get a Samsung device use Google's TTS (voices and etc.) is by hardcoding the engine name (
com.google.android.tts
) in the constructor of thetts
object as instructed by @robingenz here.Other than than, there is no way for it to dynamically switch.
Other information:
tts
with Google's if that's what is chosen. But, unfortunately, I couldn't find any function in Android that would tell which choice was made. (I am not an Android Expert, but I spent 3 hours researching!).getEngines()
returns 2 engines, but, regardless of the user's choice, the.getDefaultEngine()
is always Samsung's over there.getEngines()
anduseEngine()
(again as asked in https://github.com/capacitor-community/text-to-speech/issues/88).Thank you guys for making and maintaining this amazing plugin!