Using A Browser for TTS?
preid at reidit.co.uk
Sun Jan 6 11:25:07 CET 2019
Here's a sample HTML that plays through my default browser on my Mac:
<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
var u = new SpeechSynthesisUtterance();
u.text = '[PHRASE]';
u.lang = 'en-GB';
u.rate = [RATE];
u.name = "[VOICE]";
Generating speech for:
<i>Hello, how are you?</i>
The method is as follows:
1. Create an HTML file with the above content, replacing the [...] elements with specific text.
2. Use 'launch' to open the HTML file in the Android tablet's default browser (Firefox works well) that synthesises and plays the phrase:
launch url [path to HTML file]
3. Wait for speech to finish (I calculate an approx. duration based on the number of characters spoken)
4. Bring my app to the front or quit browser - DON'T KNOW HOW TO DO THIS!
Note that I tried using a browser widget to play the HTML/phrase but it is silent on the Android tablet (it speaks OK on the Mac).
My questions are:
Q1. Is there a simpler way of getting TTS for Android?
Q2. How can I make my app the front app and/or how can I quit another app?
Q3. How can I get the list of voices available on an Android tablet?
Q4. When will LiveCode fully support TTS and STT across Mac, Win, iOS and Android?!
More information about the use-livecode