leaonline/easy-speech

EasySpeech returns different voices set for different users

Closed this issue · 6 comments

At first, this is not an EasySpeech-specific issue. I have the same issue even when I use "window.speechSynthesis.getVoices()" directly.

On the same PC, same Edge browser, when different users get the voices list, one gets 326 while another gets 48. The 48 is part of 326.

It puzzled me. For some reason, some online voices seem only available to some users. But I still couldn't figure out the reason. Of course, I have no solution yet.

Any ideas?

I am no windows power user so I can only make assumptions. Does the user with less voices have any restrictions in terms of networking activities or permissions?

After hours of testing, finally I found the reason.

After I tried "read aloud" function of Edge (https://www.microsoft.com/en-us/edge/features/read-aloud?form=MT00D8), the available voices will be increased to 326 from 48.

So the "read aloud" function of Edge does some magic behind.

How to make it happen automatically? I have no idea. If someone can finger out, please share with us.

I see this behavior as well. For some browsers like Safari, some voices are not available (Google voices for eg.) so I suspect that the voice fallback is the first in the voices array (just a guess).

you can see it happening here:
https://bbcj2q.csb.app/

On Chrome, it has the Google UK Male voice, but since this isn't available on Safari, it defaults to the Arab voice:

Screenshot 2023-06-01 at 11 26 52 AM

The workaround I use when this happens is to have different speak functions and after detecting browsers, I conditionally call one or the other. Not optimal because, you'll need "n" speak functions / browser or to select a voice that is available on all browsers.

If there is a better way, pls suggest

The workaround I use when this happens is to have different speak functions and after detecting browsers, I conditionally call one or the other. Not optimal because, you'll need "n" speak functions / browser or to select a voice that is available on all browsers.

@nonoumasy Can you provide a little code snippet on how this looks like?

I will close this for now. Feel free to reopen if you think it's worth to keep discussed.