Skip to content

Commit

Permalink
fixed TTS speaking twice
Browse files Browse the repository at this point in the history
added build-extras (tbd, include on build)
  • Loading branch information
Shmarkus committed Oct 5, 2016
1 parent e6a0f6f commit bdfcfae
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-nuance-speechkit",
"version": "1.0.0",
"version": "1.0.1",
"description": "Cordova Nuance SpeechKit Plugin",
"cordova": {
"id": "cordova-plugin-nuance-speechkit",
Expand Down
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-nuance-speechkit"
version="1.0.0">
version="1.0.1">
<name>Nuance SpeechKit</name>
<description>Cordova Nuance SpeechKit Plugin</description>
<license>Apache 2.0</license>
Expand All @@ -35,7 +35,6 @@
<engines>
<engine name="cordova" version=">=3.0.0" />
</engines>

<!-- android -->
<platform name="android">
<config-file target="res/xml/config.xml" parent="/*">
Expand All @@ -49,6 +48,7 @@
<uses-permission android:name="android.permission.INTERNET"/>
</config-file>


<source-file src="src/android/SpeechKit.java" target-dir="src/ee/helmes" />
<source-file src="src/android/libs/speechkit-2.1.3.aar" target-dir="libs" />
</platform>
Expand Down
3 changes: 1 addition & 2 deletions src/android/SpeechKit.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ private void startTTS(JSONArray args) {
options.setLanguage(new Language(args.getString(1)));
Transaction transaction = session.speakString(textToSpeak, options, new Transaction.Listener() {
public void onAudio(Transaction transaction, Audio audio) {
Log.d(TAG, "Speaking: " + textToSpeak);
session.getAudioPlayer().playAudio(audio);
//when text is received, it starts playback automatically
}
public void onSuccess(Transaction transaction, String s) {
Log.d(TAG, "Successful transaction: " + s);
Expand Down
8 changes: 8 additions & 0 deletions src/android/build-extras.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile (name: "speechkit-2.1.3", ext: "aar")
}

0 comments on commit bdfcfae

Please sign in to comment.