Files
2018-09-22 10:44:38 +08:00

28 lines
544 B
JavaScript

/*
Cordova Text-to-Speech Plugin
https://github.com/vilic/cordova-plugin-tts
by VILIC VANE
https://github.com/vilic
MIT License
*/
exports.speak = function (text, onfulfilled, onrejected) {
var options = {};
if (typeof text == 'string') {
options.text = text;
} else {
options = text;
}
cordova
.exec(function () {
onfulfilled();
}, function (reason) {
onrejected(reason);
}, 'TTS', 'speak', [options]);
};