Nodular Pudding Multiverse

    This package has been deprecated

    Author message:

    This package is deprecated, see https://blog.phonegap.com/update-for-customers-using-phonegap-and-phonegap-build-cc701c77502c

    phonegap-plugin-speech-synthesis

    0.1.1 • Public • Published

    SpeechSynthesisPlugin

    W3C Web Speech API - Speech synthesis plugin for PhoneGap

    Installation

    Phone Gap

    Using the command line tools run:

    phonegap plugin add https://github.com/macdonst/SpeechSynthesisPlugin
    cordova plugin add https://github.com/macdonst/SpeechSynthesisPlugin
    

    Cordova

    This plugin also works with the Apache Cordova toolset. See this Github project for an example for Android:

    https://github.com/andysylvester/talk-to-me-cordova
    

    More info on using this plugin with Cordova is available at this blog post.

    Example Code

    This code from the above Github project shows how to read the value of a text field, set up the plugin to speak that text, and vibrate the phone for 2 seconds:

     function playVibrate() {
        var u = new SpeechSynthesisUtterance();
        var x = document.getElementById("frm1");
        var txt = "";
        txt = x.elements[0].value
        u.text = txt;
        u.lang = 'en-US';
        speechSynthesis.speak(u);      
        navigator.notification.vibrate(2000);
        document.getElementById("frm1").reset();
      }
    

    Install

    npm i phonegap-plugin-speech-synthesis

    DownloadsWeekly Downloads

    30

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • jcesarmobile
    • macdonst