@red-mobile/cordova-plugin-speech-synthesis

0.4.0 • Public • Published

cordova-plugin-speech-synthesis

W3C Web Speech API - Speech synthesis plugin for Cordova

Installation

Using the command line tools run:

cordova plugin add @red-mobile/cordova-plugin-speech-synthesis

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();
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.4.0
    12
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.4.0
    12
  • 0.3.0
    0
  • 0.2.0
    0

Package Sidebar

Install

npm i @red-mobile/cordova-plugin-speech-synthesis

Weekly Downloads

12

Version

0.4.0

License

MIT

Unpacked Size

17.1 kB

Total Files

11

Last publish

Collaborators

  • okhiroyuki