Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
# Change Log

2018/05/30
==========

Improved compatibility with the W3C specification (https://w3c.github.io/speech-api/webspeechapi.html) and other improvements.
* Added `voicechanged` event.
* Error events from Android now include the `error` value and message.
* Removed SpeechSynthesisVoiceList.

2019/03/13
==========

Added iOS implementation. Apple's implementation of speechSynthesis
crashes in heavy use. In particular, crashes were seen when used with
wifisher's phonegap-plugin-speechsynthesis plugin.
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
# SpeechSynthesisPlugin

W3C Web Speech API - Speech synthesis plugin for PhoneGap
W3C Web Speech API - Speech synthesis plugin for Cordova/PhoneGap.

This Cordova plugin provides speech synthesis support for Android, Apple iOS, Windows 10, and the Browser.
It attempts to closely follow the
[SpeechSynthesis](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis)
interface as defined by the
[Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API).

This plugin provides a native implementation for Android and iOS.
For Windows 10, and Browser, the native webview implementation is used.

# Installation

## Phone Gap
## Cordova

Using the command line tools run:

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

## Cordova
# Cordova Usage

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

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

More info on using this plugin with Cordova is available at this <a href="http://andysylvester.com/2014/02/08/first-steps-with-cordova-talk-to-me/">blog post</a>.


# Example Code

## 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:

Expand All @@ -32,7 +38,7 @@ This code from the above Github project shows how to read the value of a text fi
txt = x.elements[0].value
u.text = txt;
u.lang = 'en-US';
speechSynthesis.speak(u);
speechSynthesis.speak(u);
navigator.notification.vibrate(2000);
document.getElementById("frm1").reset();
}
Loading