Skip to content

Commit

Permalink
fix startTTS not working on IOS, closes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Shmarkus committed Oct 30, 2018
1 parent 7724425 commit b36f294
Show file tree
Hide file tree
Showing 3 changed files with 11 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": "2.0.0",
"version": "2.0.1",
"description": "Cordova Nuance SpeechKit Plugin",
"cordova": {
"id": "cordova-plugin-nuance-speechkit",
Expand Down
2 changes: 1 addition & 1 deletion 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="2.0.0">
version="2.0.1">
<name>Nuance SpeechKit</name>
<description>Cordova Nuance SpeechKit Plugin</description>
<license>Apache 2.0</license>
Expand Down
12 changes: 9 additions & 3 deletions src/ios/CDVSpeechKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ - (void) pluginInitialize {
- (void) startTTS:(CDVInvokedUrlCommand*)command{

NSLog(@"CDVSpeechKit.startTTS: Entered method.");
SKTransaction* transaction = [session speakString:[command.arguments objectAtIndex:0]
withLanguage:[command.arguments objectAtIndex:1]
withVoice:[command.arguments objectAtIndex:2]
// If the voice is nil, use language default voice. If the voice is set, ignore language and use voices default lang.
if ([command.arguments objectAtIndex:2] == nil) {
SKTransaction* transaction = [session speakString:[command.arguments objectAtIndex:0]
withLanguage:[command.arguments objectAtIndex:1]
delegate:self];
} else {
SKTransaction* transaction = [session speakString:[command.arguments objectAtIndex:0]
withVoice:[command.arguments objectAtIndex:2]
delegate:self];
}
NSLog(@"CDVSpeechKit.startTTS: Leaving method.");
}
@end

0 comments on commit b36f294

Please sign in to comment.