Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
macdonst authored Jun 1, 2017
2 parents 002d79f + d5601ac commit c8e3a37
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 13 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#SpeechSynthesisPlugin
# SpeechSynthesisPlugin

W3C Web Speech API - Speech synthesis plugin for PhoneGap

#Installation
# Installation

##Phone Gap
## 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
## Cordova

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

Expand All @@ -20,7 +20,7 @@ This plugin also works with the Apache Cordova toolset. See this Github project
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 Down
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "phonegap-plugin-speech-synthesis",
"version": "0.1.0",
"description": "W3C Web Speech API - Speech synthesis plugin for PhoneGap",
"homepage": "https://github.com/macdonst/SpeechSynthesisPlugin#readme",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/macdonst/SpeechSynthesisPlugin.git"
},
"bugs": {
"url": "https://github.com/macdonst/SpeechSynthesisPlugin/issues"
},
"cordova": {
"id": "phonegap-plugin-speech-synthesis",
"platforms": [
"ios",
"android",
"browser"
]
},
"keywords": [
"ecosystem:cordova",
"ecosystem:phonegap",
"cordova-ios",
"cordova-android",
"cordova-browser"
],
"author": "Simon MacDonald",
"license": "MIT"
}
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
id="org.apache.cordova.speech.speechsynthesis"
id="phonegap-plugin-speech-synthesis"
version="0.1.0">
<name>SpeechSynthesis</name>
<description>Cordova Speech Synthesis Plugin</description>
Expand Down Expand Up @@ -38,5 +38,5 @@
<clobbers target="SpeechSynthesisVoiceList" />
</js-module>
</platform>

</plugin>
2 changes: 1 addition & 1 deletion src/android/SpeechSynthesis.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ private boolean isReady() {
* @param status
*/
public void onInit(int status) {
if (status == TextToSpeech.SUCCESS) {
if (mTts != null && status == TextToSpeech.SUCCESS) {
state = SpeechSynthesis.STARTED;
getVoices(this.startupCallbackContext);

Expand Down
6 changes: 1 addition & 5 deletions www/SpeechSynthesis.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

var exec = require("cordova/exec");
var SpeechSynthesisVoiceList = require("org.apache.cordova.speech.speechsynthesis.SpeechSynthesisVoiceList");
var SpeechSynthesisVoiceList = require("./SpeechSynthesisVoiceList");

var SpeechSynthesis = function() {
this.pending = false;
Expand Down Expand Up @@ -55,8 +55,4 @@ SpeechSynthesis.prototype.getVoices = function() {
return this._voices;
};

SpeechSynthesis.prototype.silence = function (milliseconds) {
exec(null, null, "SpeechSynthesis", "silence", [milliseconds]);
};

module.exports = new SpeechSynthesis();

0 comments on commit c8e3a37

Please sign in to comment.