User Media and Text To Speech

Discussion and feedback on Construct 2

Post » Thu Feb 02, 2017 9:15 am

Hi

I have been working on a project now and to start with I have been using the Cordova plugin TTS however this does have some limitations to it such as no control over the rate of speech etc.

Then I discovered that the user media does all of this but where I am struggling to get it to work , is on mobile platforms such as Android. Does this mean that the user media is only designed to work on a desktop environment ?

This would be a blow if so because it has so much more control that the Cordova plugin.
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Thu Feb 02, 2017 9:53 am

Hi

I've been looking at this also, but on IOS.

User Media uses the HTML5 text to speech API. Example:

var utterance = new SpeechSynthesisUtterance('Hello world');
window.speechSynthesis.speak(utterance);

This works fine on Safari on iPhone and iPad as standalone javascript. However, once it is compiled via Cordova (PhoneGap) it doesn't work.

It doesn't produce an error, and debug shows that window.speechSynthesis is an object. But the call to .speak doesn't produce sound. I attached it to a user interaction (e.g. click a button to .speech) in case it required user interactivity, still no joy.

I tried using the Cordova TTS plugin instead but it clashed with the Construct 2 audio system.

Once I've looked into this more I'll update this post with my findings.

Good luck!
B
7
S
2
Posts: 24
Reputation: 533

Post » Thu Feb 02, 2017 1:46 pm

AaronSmithUK wrote:Hi

I've been looking at this also, but on IOS.

User Media uses the HTML5 text to speech API. Example:

var utterance = new SpeechSynthesisUtterance('Hello world');
window.speechSynthesis.speak(utterance);

This works fine on Safari on iPhone and iPad as standalone javascript. However, once it is compiled via Cordova (PhoneGap) it doesn't work.

It doesn't produce an error, and debug shows that window.speechSynthesis is an object. But the call to .speak doesn't produce sound. I attached it to a user interaction (e.g. click a button to .speech) in case it required user interactivity, still no joy.

I tried using the Cordova TTS plugin instead but it clashed with the Construct 2 audio system.

Once I've looked into this more I'll update this post with my findings.

Good luck!


Hi AaronSmithUK

Thanks for your reply on this not sure if your problems with Cordova TTS relate to the ones I have had where I am switching spoken languages and even when I do the speech sometimes ends up in the wrong language.

What I have found with the User Audio TTS is if you open the example capx file that comes with Construct 2 and compile it for Android , the app immediately warns you that it cannot find the speech data or something of that kind.

I have emailed the author of the Cordova TTS about the need of a rate control but I have not heard anything back :(
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Sun Apr 30, 2017 2:25 pm

It's not just a TTS problem with User Media plugin. The entire User Media plugin doesn't work when you export to cordova, and it's not able to access mobile device camera, mic, etc... from native apps.
B
11
S
3
G
1
Posts: 19
Reputation: 905

Post » Tue Oct 03, 2017 4:31 am

hi

I too would like to get TTS working in my spelling game.

I found this plugin "cordova-plugin-tts" in the cocoon.io in the plugin section of your project within the project setting options.
I think requires the "Cordova TextToSpeech: text to speech" from the Construct2 Cordova Plugins.

Have a look at this link
https://github.com/vilic/cordova-plugin-tts#readme

hope this helps
B
24
S
8
Posts: 46
Reputation: 1,894

Post » Tue Oct 03, 2017 8:04 pm

henryScirra wrote:hi

I too would like to get TTS working in my spelling game.

I found this plugin "cordova-plugin-tts" in the cocoon.io in the plugin section of your project within the project setting options.
I think requires the "Cordova TextToSpeech: text to speech" from the Construct2 Cordova Plugins.

Have a look at this link
https://github.com/vilic/cordova-plugin-tts#readme

hope this helps


I have this plug in but I still cannot get it to work with phonegap
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921


Return to Construct 2 General

Who is online

Users browsing this forum: bbjGames and 5 guests