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: 128
Reputation: 1,913

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: 22
Reputation: 529

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: 128
Reputation: 1,913

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


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 13 guests