capacitor-community / text-to-speech

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

Error: Unsupported locale #5

Closed KrishnaPhalgun5168 closed 3 years ago

KrishnaPhalgun5168 commented 4 years ago

Describe the bug TextToSpeech.getSupportedLanguages() returns undefined in web & android platforms not sure about ios.

Workaround Pass undefined to locale property

trizotti commented 3 years ago

@KrishnaPhalgun5168 , do you know what to do if I want to use another languges? This workaround forces english selection...

KrishnaPhalgun5168 commented 3 years ago

@trizotti I have no clue how to use it for other languages. Did you try changing the default speech-language of your device?

trizotti commented 3 years ago

@KrishnaPhalgun5168 , it seems that any locale passed through the speak method will be reconized as unsupported (I think it should be fixed soon, there's an issue open for this). A simple and temporary workaround for those who are facing the same situation: set the default language as the choosen language on the file TextToSpeech.java

robingenz commented 3 years ago

Fixed for Android with #29

robingenz commented 3 years ago

Fixed for Web with #33 You can give it a try: npm i @capacitor-community/text-to-speech@0.2.1-dev.65857f5