Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Safari SpeechSynthesisUtterance can not set language

I have SpeechSynthesisUtterance working in my native language (English) but I need to set the language to Italian for correct pronunciation.

The code works correctly in Mac Safari but in iOS Safari the pronunciation is English not Italian.

An easy test is the Italian: "Ho i soldi", "h"is silent in Italian.

<!DOCTYPE html><html lang='en' class=''>

<head><meta charset='UTF-8'></head>
<body>

<button id="Ho una prenotazione." onclick=speak(id)>Ho una prenotazione.</button>
I have a reservation

<script >
    function speak(text) {
        var msg    = new SpeechSynthesisUtterance(text);
        msg.lang = 'it-IT';
        window.speechSynthesis.speak(msg);
    }
</script>


</body></html>

Here is a test example of the above code.

I have downloaded Italian "Luca" and have set it as the Default at Settings:General:Accessibility:Speech:Voices:Italian;Luca

Note:

I have posted an inquiry to the Apple Safari and Web Development Forum on Jul 26, 2018 with the result of no response to date: (422 Views, 0 Replies).

I have also submitted an Apple Developer Technical Support (DTS) request August 16, 2018 that was declined with a suggestion to post to the Web Development Forum.

This while this might be deemed off-topic please consider I have tried debugging and requested help from Apple which has been ignored and denied.

Udate:

Thus seems to be an iOS beta issue, even the Chrome and Firefox apps has the English pronunciation. I have files a Beta bug report on this issue.

like image 487
zaph Avatar asked Aug 18 '18 01:08

zaph


1 Answers

I have to little rep to post this in the comments so i will post it as an answer. I see that you are running iphone 6s, but i tried it on my iphone X and on my Mac with both english and italian in different browsers.

There is a possibility that the problem persists within your phone or os because it seems to work perfect on my devices, have you tried any other devices than your iphone 6s?

like image 102
Stanley Avatar answered Nov 14 '22 22:11

Stanley