Closed d3mac123 closed 7 years ago
Here's the answer:
var TextToSpeech = require("nativescript-texttospeech");
var TTS = new TextToSpeech.TNSTextToSpeech();
var speakOptions = {
text: L('msgTimeFlyTitle')+L('msgTimeFly'),
speakRate: 0.5,
pitch: 1.0,
volume: 1.0 //,
locale: "en-GB",
finishedCallback: Function // optional
};
// Call the `speak` method passing the SpeakOptions object
TTS.speak(speakOptions).then(function () {
// everything is fine
}, function (err) {
// oops, something went wrong!
});
I know this is a stupid question (I recognize my limited skills) but, how do I translate the Typescript example below to pure Javascript?