Welcome Guest Search | Active Topics | Sign In | Register

SpeechSynthesis support? Options
Christian Porzio
Posted: Friday, November 17, 2017 10:19:23 AM
Rank: Advanced Member
Groups: Member

Joined: 10/4/2016
Posts: 104
Hi,

We are testing the speechSynthesis features and the code below works in Chrome but remains mute with EO.Web though during debugging it seems the functions do exist.

Any idea?

Thank you

Code: JavaScript
var utterance = new SpeechSynthesisUtterance('Hello World');
window.speechSynthesis.speak(utterance);
Christian Porzio
Posted: Friday, November 17, 2017 11:32:31 AM
Rank: Advanced Member
Groups: Member

Joined: 10/4/2016
Posts: 104
I found out the list of voices returned by window.speechSynthesis.getVoices() is empty and there are some post regarding that issue (https://stackoverflow.com/questions/21513706/getting-the-list-of-voices-in-speechsynthesis-of-chrome-web-speech-api), but the workaround to get voices is not working for me in EO.Browser.

Thank you

eo_support
Posted: Friday, November 17, 2017 3:05:47 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

Have you tried to set your Google API key? I do not think the speech synthesis is done by the browser engine --- it's done by Google's server and the browser engine just calls it.

See here for more information on Google API key:

https://www.essentialobjects.com/doc/webbrowser/advanced/google_service.aspx

Thanks!
Christian Porzio
Posted: Friday, November 17, 2017 4:23:38 PM
Rank: Advanced Member
Groups: Member

Joined: 10/4/2016
Posts: 104
Thank you for your follow up.

I did not know about this feature but after a look at your suggestion, I do not think this applies to the issue.

There is no Speech Synthesis API per se, there is a speech recognition (speech to text) but that is not what we are trying to do - though it is good to know for potential future apps.

The only problem here is that there is no voices in the list returned by GetVoices().

The page below works in Chrome and Firefox but returns the error message: "I lost my voices" with EO.Web - I tried it also in the TabbedBrowser.

I suspect there is something to do with the issue reported in this post: https://stackoverflow.com/questions/21513706/getting-the-list-of-voices-in-speechsynthesis-of-chrome-web-speech-api

But I cannot get it to work either way.

Code: HTML/ASPX
<!doctype html>
<html lang="en">
<head>
    <title>Speak to me!</title>
</head>
<body>
    <div id="MyPage">
        <p>
            <button onclick="SpeakToMe('Hello World'); return false">Speak to me!</button>
        </p>
    </div>

    <script>

        function SpeakToMe(phrase) {
            if (window.speechSynthesis !== undefined) {
		var utterance = new SpeechSynthesisUtterance(phrase);
                var synth = window.speechSynthesis;
                var voices = synth.getVoices();
                if (voices.length == 0)
                    alert("I lost my voices :-(");
                else
                    synth.speak(utterance);
            }
	    else
                alert("I am mute forever!");
        }

    </script>

</body>
</html>


Of course that does not work at all in IE where it fails to acquire the SpeechSynthesisUtterance instance.
eo_support
Posted: Monday, November 20, 2017 12:51:07 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

We have looked into this and this is not supported in the current version but will be supported in our next version.

While we look into this issue, we have also noticed an interesting detail on Chromium's TTS implementation: the voices list is lazy initialized when you first access window.speechSynthesis property and the initialization is asynchronous. This means that if you call getVoices immediately after first accessing window.speechSynthesis you will get an empty list. However if you call it again later you will get the correct list. Google Chrome browser demonstrates the same behavior. So that might be something you want to keep in mind when you write your code.

Thanks!
eo_support
Posted: Friday, December 1, 2017 8:40:04 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

This is just to let you know that we have posted a new build that should support speech synthesis. You can download the new build from our download page. Please take a look and let us know how it goes.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.