반응형


https://github.com/vilic/cordova-plugin-tts


 error issue :  https://forum.ionicframework.com/t/problems-with-text-to-speech/31927


Cordova Text-to-Speech Plugin

Platforms

iOS 7+
Windows Phone 8
Android 4.0.3+ (API Level 15+)

Installation

cordova plugin add cordova-plugin-tts

Usage

// make sure your the code gets executed only after `deviceready`.
document.addEventListener('deviceready', function () {
    // basic usage
    TTS
        .speak('hello, world!', function () {
            alert('success');
        }, function (reason) {
            alert(reason);
        });
    
    // or with more options
    TTS
        .speak({
            text: 'hello, world!',
            locale: 'en-GB',
            rate: 0.75
        }, function () {
            alert('success');
        }, function (reason) {
            alert(reason);
        });
}, false);

Tips: speak an empty string to interrupt.

반응형

+ Recent posts