react-native-davoice 1.0.30 → 1.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. package/TTSRNBridge.podspec +1 -1
  2. package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar +0 -0
  3. package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar.md5 +1 -1
  4. package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar.sha1 +1 -1
  5. package/ios/TTSRNBridge/DaVoiceTTSBridge.m +24 -1
  6. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/DavoiceTTS +0 -0
  7. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +8276 -8256
  8. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +57 -57
  9. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftinterface +57 -57
  10. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/DavoiceTTS +0 -0
  11. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +5766 -5746
  12. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +63 -63
  13. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface +63 -63
  14. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +5766 -5746
  15. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +63 -63
  16. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +63 -63
  17. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeDirectory +0 -0
  18. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeRequirements-1 +0 -0
  19. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeResources +24 -24
  20. package/package.json +1 -1
  21. package/speech/index.ts +86 -18
@@ -2,7 +2,7 @@ require 'json'
2
2
 
3
3
  Pod::Spec.new do |s|
4
4
  s.name = "TTSRNBridge"
5
- s.version = "1.0.247" # Update to your package version
5
+ s.version = "1.0.253" # Update to your package version
6
6
  s.summary = "TTS for React Native."
7
7
  s.description = <<-DESC
8
8
  A React Native module for tts .
@@ -1 +1 @@
1
- 31339323b8cc47df42fbc34611b21639 tts-1.0.0.aar
1
+ ce4aa4dc86cc3eb0856d133171027d42 tts-1.0.0.aar
@@ -1 +1 @@
1
- dfb8006150a99e45bd872ce911b1e890b920c93d tts-1.0.0.aar
1
+ 3d4da3dd6a6f3f157344c3404b3a123d01685810 tts-1.0.0.aar
@@ -99,7 +99,9 @@ RCT_EXPORT_METHOD(initTTS:(NSDictionary *)configDict
99
99
  return;
100
100
  }
101
101
 
102
- NSURL *modelURL = [NSURL fileURLWithPath:modelPath];
102
+ NSURL *modelURL = [modelPath hasPrefix:@"file://"]
103
+ ? [NSURL URLWithString:modelPath]
104
+ : [NSURL fileURLWithPath:modelPath];
103
105
 
104
106
  dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
105
107
  NSError *error = nil;
@@ -110,6 +112,9 @@ RCT_EXPORT_METHOD(initTTS:(NSDictionary *)configDict
110
112
  }
111
113
 
112
114
  dispatch_async(dispatch_get_main_queue(), ^{
115
+ if (self.ttsInstance) {
116
+ @try { [self.ttsInstance stopSpeaking]; [self.ttsInstance destroy]; } @catch (__unused id e) {}
117
+ }
113
118
  self.ttsInstance = tts;
114
119
 
115
120
  __weak typeof(self) weakSelf = self;
@@ -142,6 +147,24 @@ RCT_EXPORT_METHOD(initTTS:(NSDictionary *)configDict
142
147
  });
143
148
  }
144
149
 
150
+ RCT_EXPORT_METHOD(speakWithSpeed:(NSString *)text
151
+ speakerId:(nonnull NSNumber *)speakerId
152
+ speed:(nonnull NSNumber *)speed
153
+ resolver:(RCTPromiseResolveBlock)resolve
154
+ rejecter:(RCTPromiseRejectBlock)reject)
155
+ {
156
+ if (!self.ttsInstance) {
157
+ reject(@"no_instance", @"TTS not initialized", nil);
158
+ return;
159
+ }
160
+
161
+ dispatch_async(dispatch_get_main_queue(), ^{
162
+ float s = speed ? speed.floatValue : 1.0f;
163
+ [self.ttsInstance speak:text sid:speakerId.intValue speed:s];
164
+ resolve(@"Speaking");
165
+ });
166
+ }
167
+
145
168
  RCT_EXPORT_METHOD(stopSpeaking:(RCTPromiseResolveBlock)resolve
146
169
  rejecter:(RCTPromiseRejectBlock)reject)
147
170
  {