HadrienGardeur / web-speech-recommended-voices

A list of recommended voices for the Web Speech API
https://hadriengardeur.github.io/web-speech-recommended-voices/
Creative Commons Zero v1.0 Universal
17 stars 1 forks source link

Android: SpeechSynthesisUtterance requires lang field, even after setting voice. #37

Open rbozan opened 4 months ago

rbozan commented 4 months ago

There's one caveat which I noticed with the API on Android, which is that the voice does not work unless the lang property is also set. You can set the lang property to the value of voice.lang and it'll work, but keeping it undefined makes voice not work at all.

HadrienGardeur commented 4 months ago

Thanks, that's a good catch. I'm also adding that one to the project dedicated to well-known issues. I'll also have to tweak my demo to take this into account.

You can set the lang property to the value of voice.lang and it'll work, but keeping it undefined makes voice not work at all.

Just to clarify that one, by "not work at all", do you mean that it defaults to the system default or that the playback doesn't even start at all?

HadrienGardeur commented 4 months ago

Also worth mentioning that https://github.com/HadrienGardeur/read-aloud-best-practices/issues/6 remains an issue, in addition to setting up lang on SpeechSynthesisUtterance.

rbozan commented 4 months ago

Thanks, that's a good catch. I'm also adding that one to the project dedicated to well-known issues. I'll also have to tweak my demo to take this into account.

You can set the lang property to the value of voice.lang and it'll work, but keeping it undefined makes voice not work at all.

Just to clarify that one, by "not work at all", do you mean that it defaults to the system default or that the playback doesn't even start at all?

Yes I meant that it uses the system default.

What I don't understand is that its stated that voice packs must be installed for the voice to work but I don't think I have installed the voice pack and it still works.

HadrienGardeur commented 4 months ago

What I don't understand is that its stated that voice packs must be installed for the voice to work but I don't think I have installed the voice pack and it still works.

Voice packs are pre-loaded for a number of languages by default on Android.

HadrienGardeur commented 4 months ago

@rbozan I did some additional testing and you're right, something has changed on Android compared to some of my previous test.

Here's what I did:

I'm running the beta version of Android 15, but this could also be related to a Chrome update. I'll need to do some additional testing, I'm mostly wondering why it fallbacks to another voice when the voice pack is uninstalled.

rbozan commented 4 months ago

Thanks a lot for the testing by the way, it helps me a bunch