|
| 1 | +diff --git a/node_modules/react-native-tts/android/build.gradle b/node_modules/react-native-tts/android/build.gradle |
| 2 | +index dbbe046..ab08997 100644 |
| 3 | +--- a/node_modules/react-native-tts/android/build.gradle |
| 4 | ++++ b/node_modules/react-native-tts/android/build.gradle |
| 5 | +@@ -3,12 +3,18 @@ def safeExtGet(prop, fallback) { |
| 6 | + } |
| 7 | + |
| 8 | + buildscript { |
| 9 | +- repositories { |
| 10 | +- jcenter() |
| 11 | +- } |
| 12 | ++ // The Android Gradle plugin is only required when opening the android folder stand-alone. |
| 13 | ++ // This avoids unnecessary downloads and potential conflicts when the library is included as a |
| 14 | ++ // module dependency in an application project. |
| 15 | ++ // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies |
| 16 | ++ if (project == rootProject) { |
| 17 | ++ repositories { |
| 18 | ++ google() |
| 19 | ++ } |
| 20 | + |
| 21 | +- dependencies { |
| 22 | +- classpath 'com.android.tools.build:gradle:1.3.1' |
| 23 | ++ dependencies { |
| 24 | ++ classpath 'com.android.tools.build:gradle:1.3.1' |
| 25 | ++ } |
| 26 | + } |
| 27 | + } |
| 28 | + |
| 29 | +diff --git a/node_modules/react-native-tts/ios/TextToSpeech/TextToSpeech.m b/node_modules/react-native-tts/ios/TextToSpeech/TextToSpeech.m |
| 30 | +index 1e769cc..3ea3767 100644 |
| 31 | +--- a/node_modules/react-native-tts/ios/TextToSpeech/TextToSpeech.m |
| 32 | ++++ b/node_modules/react-native-tts/ios/TextToSpeech/TextToSpeech.m |
| 33 | +@@ -38,9 +38,9 @@ -(instancetype)init |
| 34 | + return self; |
| 35 | + } |
| 36 | + |
| 37 | +-+ (BOOL)requiresMainQueueSetup |
| 38 | +++ (bool)requiresMainQueueSetup |
| 39 | + { |
| 40 | +- return YES; |
| 41 | ++ return true; |
| 42 | + } |
| 43 | + |
| 44 | + RCT_EXPORT_METHOD(speak:(NSString *)text |
| 45 | +@@ -94,7 +94,7 @@ + (BOOL)requiresMainQueueSetup |
| 46 | + resolve([NSNumber numberWithUnsignedLong:utterance.hash]); |
| 47 | + } |
| 48 | + |
| 49 | +-RCT_EXPORT_METHOD(stop:(BOOL *)onWordBoundary resolve:(RCTPromiseResolveBlock)resolve reject:(__unused RCTPromiseRejectBlock)reject) |
| 50 | ++RCT_EXPORT_METHOD(stop:(bool *)onWordBoundary resolve:(RCTPromiseResolveBlock)resolve reject:(__unused RCTPromiseRejectBlock)reject) |
| 51 | + { |
| 52 | + AVSpeechBoundary boundary; |
| 53 | + |
| 54 | +@@ -104,12 +104,12 @@ + (BOOL)requiresMainQueueSetup |
| 55 | + boundary = AVSpeechBoundaryImmediate; |
| 56 | + } |
| 57 | + |
| 58 | +- BOOL stopped = [self.synthesizer stopSpeakingAtBoundary:boundary]; |
| 59 | ++ bool stopped = [self.synthesizer stopSpeakingAtBoundary:boundary]; |
| 60 | + |
| 61 | + resolve([NSNumber numberWithBool:stopped]); |
| 62 | + } |
| 63 | + |
| 64 | +-RCT_EXPORT_METHOD(pause:(BOOL *)onWordBoundary resolve:(RCTPromiseResolveBlock)resolve reject:(__unused RCTPromiseRejectBlock)reject) |
| 65 | ++RCT_EXPORT_METHOD(pause:(bool *)onWordBoundary resolve:(RCTPromiseResolveBlock)resolve reject:(__unused RCTPromiseRejectBlock)reject) |
| 66 | + { |
| 67 | + AVSpeechBoundary boundary; |
| 68 | + |
| 69 | +@@ -119,20 +119,20 @@ + (BOOL)requiresMainQueueSetup |
| 70 | + boundary = AVSpeechBoundaryImmediate; |
| 71 | + } |
| 72 | + |
| 73 | +- BOOL paused = [self.synthesizer pauseSpeakingAtBoundary:boundary]; |
| 74 | ++ bool paused = [self.synthesizer pauseSpeakingAtBoundary:boundary]; |
| 75 | + |
| 76 | + resolve([NSNumber numberWithBool:paused]); |
| 77 | + } |
| 78 | + |
| 79 | + RCT_EXPORT_METHOD(resume:(RCTPromiseResolveBlock)resolve reject:(__unused RCTPromiseRejectBlock)reject) |
| 80 | + { |
| 81 | +- BOOL continued = [self.synthesizer continueSpeaking]; |
| 82 | ++ bool continued = [self.synthesizer continueSpeaking]; |
| 83 | + |
| 84 | + resolve([NSNumber numberWithBool:continued]); |
| 85 | + } |
| 86 | + |
| 87 | + |
| 88 | +-RCT_EXPORT_METHOD(setDucking:(BOOL *)ducking |
| 89 | ++RCT_EXPORT_METHOD(setDucking:(bool *)ducking |
| 90 | + resolve:(RCTPromiseResolveBlock)resolve |
| 91 | + reject:(__unused RCTPromiseRejectBlock)reject) |
| 92 | + { |
| 93 | +@@ -178,7 +178,7 @@ + (BOOL)requiresMainQueueSetup |
| 94 | + } |
| 95 | + |
| 96 | + RCT_EXPORT_METHOD(setDefaultRate:(float)rate |
| 97 | +- skipTransform:(BOOL *)skipTransform // not used, compatibility with Android native module signature |
| 98 | ++ skipTransform:(bool *)skipTransform // not used, compatibility with Android native module signature |
| 99 | + resolve:(RCTPromiseResolveBlock)resolve |
| 100 | + reject:(RCTPromiseRejectBlock)reject) |
| 101 | + { |
| 102 | +@@ -232,7 +232,7 @@ + (BOOL)requiresMainQueueSetup |
| 103 | + -(void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didStartSpeechUtterance:(AVSpeechUtterance *)utterance |
| 104 | + { |
| 105 | + if(_ducking) { |
| 106 | +- [[AVAudioSession sharedInstance] setActive:YES error:nil]; |
| 107 | ++ [[AVAudioSession sharedInstance] setActive:true error:nil]; |
| 108 | + } |
| 109 | + |
| 110 | + [self sendEventWithName:@"tts-start" body:@{@"utteranceId":[NSNumber numberWithUnsignedLong:utterance.hash]}]; |
| 111 | +@@ -241,7 +241,7 @@ -(void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didStartSpeechUttera |
| 112 | + -(void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didFinishSpeechUtterance:(AVSpeechUtterance *)utterance |
| 113 | + { |
| 114 | + if(_ducking) { |
| 115 | +- [[AVAudioSession sharedInstance] setActive:NO error:nil]; |
| 116 | ++ [[AVAudioSession sharedInstance] setActive:false error:nil]; |
| 117 | + } |
| 118 | + |
| 119 | + [self sendEventWithName:@"tts-finish" body:@{@"utteranceId":[NSNumber numberWithUnsignedLong:utterance.hash]}]; |
| 120 | +@@ -250,7 +250,7 @@ -(void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didFinishSpeechUtter |
| 121 | + -(void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didPauseSpeechUtterance:(AVSpeechUtterance *)utterance |
| 122 | + { |
| 123 | + if(_ducking) { |
| 124 | +- [[AVAudioSession sharedInstance] setActive:NO error:nil]; |
| 125 | ++ [[AVAudioSession sharedInstance] setActive:false error:nil]; |
| 126 | + } |
| 127 | + |
| 128 | + [self sendEventWithName:@"tts-pause" body:@{@"utteranceId":[NSNumber numberWithUnsignedLong:utterance.hash]}]; |
| 129 | +@@ -259,7 +259,7 @@ -(void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didPauseSpeechUttera |
| 130 | + -(void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didContinueSpeechUtterance:(AVSpeechUtterance *)utterance |
| 131 | + { |
| 132 | + if(_ducking) { |
| 133 | +- [[AVAudioSession sharedInstance] setActive:YES error:nil]; |
| 134 | ++ [[AVAudioSession sharedInstance] setActive:true error:nil]; |
| 135 | + } |
| 136 | + |
| 137 | + [self sendEventWithName:@"tts-resume" body:@{@"utteranceId":[NSNumber numberWithUnsignedLong:utterance.hash]}]; |
| 138 | +@@ -276,7 +276,7 @@ -(void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer willSpeakRangeOfSpee |
| 139 | + -(void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didCancelSpeechUtterance:(AVSpeechUtterance *)utterance |
| 140 | + { |
| 141 | + if(_ducking) { |
| 142 | +- [[AVAudioSession sharedInstance] setActive:NO error:nil]; |
| 143 | ++ [[AVAudioSession sharedInstance] setActive:false error:nil]; |
| 144 | + } |
| 145 | + |
| 146 | + [self sendEventWithName:@"tts-cancel" body:@{@"utteranceId":[NSNumber numberWithUnsignedLong:utterance.hash]}]; |
0 commit comments