Speech Synthesis play incorrect
Categories
(Core :: Web Speech, defect, P3)
Tracking
()
People
(Reporter: karlcow, Unassigned)
References
()
Details
(Whiteboard: [webcompat])
This is https://webcompat.com/issues/27221
and here what the reporter said:
I wrote a simple javascript as below.
when I set lang = 'cmn' (Mandarin Chinese).
it works well in firefox for Android, or Chrome mobile and desktop versions.
however, in firefox desktop version for Ubuntu 18, the speech is unrecognizable.
=========== java script Begin =================
function Sayit() {
let u = new SpeechSynthesisUtterance();
u.lang = 'cmn';
u.text = "早安";
speechSynthesis.speak(u);
}
=========== java script End =================
<details>
<summary>Browser Configuration</summary>
<ul>
<li>None</li>
</ul>
</details>
Reported by @stevene29f
Comment 1•6 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Comment 2•6 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Comment 3•6 years ago
•
|
||
This script doesn't work in both Firefox and Chrome on my OSX.
The problem in Firefox is that we couldn't find a match for lang = cmn
. In that case, we will use a locale lang
to synthesize voice for speaking.
It can be verified by enabling the log: $ MOZ_LOG="SpeechSynthesis:5" ./mach run
. In my case I saw:
[Parent 9252: Main Thread]: D/SpeechSynthesis nsSynthVoiceRegistry::FindBestMatch - Matched UI language (en-US ~= en-US)
[Parent 9252: Main Thread]: D/SpeechSynthesis nsSynthVoiceRegistry::SpeakImpl queueing text='早安' uri='urn:moz-tts:osx:com.apple.speech.synthesis.voice.Alex' rate=1.000000 pitch=1.000000
Chaning the cmn
to zh-cmn
works for me.
However, it seems that cmn
is valid by the spec. cmn
should be a valid BCP 47 language tag.
Comment 4•5 years ago
|
||
If I run this script in Chrome or Firefox, the result is the same (neither of which sound like Mandarin)...
Comment 6•5 years ago
|
||
This is a question better suited for Eitan.
Comment 7•5 years ago
|
||
This a Linux platform limitation, not related directly to Firefox. This is why it is reproducible in chrome as well.
Updated•5 years ago
|
Updated•3 years ago
|
Description
•