capacitor-community / text-to-speech

⚡️ Capacitor plugin for synthesizing speech from text.
MIT License
93 stars 23 forks source link

Choose tts engine option #88

Closed websorokinweb closed 1 day ago

websorokinweb commented 1 year ago

There is problem with samsung devices when using TextToSpeech.speak()

It's because tts engine on samsung it's "Samsung text-to-speech engine" that support only 7 languages by default. Only user can change preffered tts engine to Google one: Settings => General Managment => Text-to-speech => Preffered engine. When I tried ja-JP there isn't any voice because it isn't installed by default. It doesn't work in browser too.

Can you add option like "engine" to TextToSpeech.speak()? Or tryInstallLocale() to install locale to samsung's tts engine

Android: 11 (the same situation for 10) Samsung TTS engine: 3.1.02..1

websorokinweb commented 11 months ago

Hi! Could there be any progress on issue? This feature would bring new possibilites in learning languages sphere. Because not every user has tts of new language they learn and/or couldn't add it

robingenz commented 11 months ago

Hi, there are no updates yet. PRs are welcome.

websorokinweb commented 10 months ago

I would like to take care of it on Android. How I can do so?

robingenz commented 10 months ago

You need to pass the engine to the "TextToSpeech" constructor: https://github.com/capacitor-community/text-to-speech/blob/7e47148e84fa5d64b1013e5ab09ab36a24f0db8e/android/src/main/java/com/getcapacitor/community/tts/TextToSpeech.java#L33

Example:

tts = new android.speech.tts.TextToSpeech(context, this, "com.google.android.tts");
robingenz commented 1 month ago

I've just published a dev version with a new initialize(...) method which can be used to select the engine:

npm i @capacitor-community/text-to-speech@4.0.1-dev.1d4e158.1717578191

I would love to receive some feedback.

github-actions[bot] commented 1 day ago

It looks like there hasn't been a reply in 30 days, so I'm closing this issue.