react-native-davoice-tts 1.0.379 → 1.0.380

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 (26) 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/android/src/main/java/com/davoice/tts/rn/DaVoiceTTSBridge.java +28 -5
  6. package/ios/TTSRNBridge/DavoiceTTS.xcframework/Info.plist +5 -5
  7. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/DavoiceTTS +0 -0
  8. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Headers/DavoiceTTS-Swift.h +1 -0
  9. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +737 -374
  10. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +2 -0
  11. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  12. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftinterface +2 -0
  13. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/DavoiceTTS +0 -0
  14. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Headers/DavoiceTTS-Swift.h +2 -0
  15. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +737 -374
  16. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +2 -0
  17. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  18. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface +2 -0
  19. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +737 -374
  20. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +2 -0
  21. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  22. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +2 -0
  23. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeDirectory +0 -0
  24. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeRequirements-1 +0 -0
  25. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeResources +33 -33
  26. package/package.json +1 -1
@@ -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.323" # Update to your package version
5
+ s.version = "1.0.325" # 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
- 7aec61408d182775f10fa3c7a85f012e tts-1.0.0.aar
1
+ 2acd25c8a61ccb8eab617cf0337691d7 tts-1.0.0.aar
@@ -1 +1 @@
1
- 15513462e53035bc765bd8a4cd84627676a54dc6 tts-1.0.0.aar
1
+ 10c2b11937ea6d1d95ab70f7ec52e2054ba0604d tts-1.0.0.aar
@@ -38,6 +38,16 @@ public class DaVoiceTTSBridge extends ReactContextBaseJavaModule {
38
38
  private final ReactApplicationContext reactCtx;
39
39
  final String TAG = "TTS";
40
40
 
41
+ // initTTS()'s call chain (Engine.prepareTtsModelFiles -> DaVoiceTTS.createV2 ->
42
+ // TtsV2Backend's constructor) does real disk I/O plus loading/warming up
43
+ // several ONNX models -- multiple seconds on a phone. React Native's classic
44
+ // bridge already dispatches @ReactMethod calls off the main/UI thread by
45
+ // default, but that's an implicit framework behavior that can vary across RN
46
+ // versions/architectures (Turbo Modules, sync methods, etc.) -- this executor
47
+ // makes it an explicit guarantee instead of an assumption.
48
+ private final java.util.concurrent.ExecutorService initExecutor =
49
+ java.util.concurrent.Executors.newSingleThreadExecutor();
50
+
41
51
  private static void debugLog(String tag, String message) {
42
52
  if (DEBUG_LOGS_ENABLED) Log.d(tag, message);
43
53
  }
@@ -174,15 +184,28 @@ public class DaVoiceTTSBridge extends ReactContextBaseJavaModule {
174
184
  // } catch (Exception e) {
175
185
  // Log.w(TAG, "ASSETDBG list assets failed: " + e.getMessage());
176
186
  // }
187
+ // Config reads off ReadableMap must happen on this (JS-adjacent) thread --
188
+ // ReadableMap/ReadableNativeMap are not safe to access from an arbitrary
189
+ // background thread. Everything after that -- the actual heavy model I/O
190
+ // and ONNX loading -- is dispatched onto initExecutor so it never runs on
191
+ // the caller's thread regardless of what RN thread invoked this method.
192
+ final String modelPathOrURLSnapshot;
193
+ final String modelExtSnapshot;
177
194
  try {
178
195
  if (config == null || !config.hasKey("model") || config.isNull("model")) {
179
196
  promise.reject("invalid_config", "Missing required 'model' key");
180
197
  return;
181
198
  }
182
- final String modelPathOrURL = config.getString("model");
183
- final String modelExt =
184
- (config.hasKey("modelExt") && !config.isNull("modelExt"))
185
- ? config.getString("modelExt") : null;
199
+ modelPathOrURLSnapshot = config.getString("model");
200
+ modelExtSnapshot = (config.hasKey("modelExt") && !config.isNull("modelExt"))
201
+ ? config.getString("modelExt") : null;
202
+ } catch (Exception e) {
203
+ promise.reject("InitError", e.getMessage(), e);
204
+ return;
205
+ }
206
+ initExecutor.execute(() -> { try {
207
+ final String modelPathOrURL = modelPathOrURLSnapshot;
208
+ final String modelExt = modelExtSnapshot;
186
209
 
187
210
  // ✅ FIX: keep old behavior for plain asset-relative paths like "model.onnx" or "models/model.onnx"
188
211
  // (i.e. files you manually put under android/app/src/main/assets or any merged asset pack).
@@ -238,7 +261,7 @@ public class DaVoiceTTSBridge extends ReactContextBaseJavaModule {
238
261
  promise.resolve(true);
239
262
  } catch (Exception e) {
240
263
  promise.reject("InitError", e.getMessage(), e);
241
- }
264
+ } });
242
265
  }
243
266
 
244
267
  @ReactMethod
@@ -8,32 +8,32 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>DavoiceTTS.framework/DavoiceTTS</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64_x86_64-simulator</string>
11
+ <string>ios-arm64</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>DavoiceTTS.framework</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
- <string>x86_64</string>
18
17
  </array>
19
18
  <key>SupportedPlatform</key>
20
19
  <string>ios</string>
21
- <key>SupportedPlatformVariant</key>
22
- <string>simulator</string>
23
20
  </dict>
24
21
  <dict>
25
22
  <key>BinaryPath</key>
26
23
  <string>DavoiceTTS.framework/DavoiceTTS</string>
27
24
  <key>LibraryIdentifier</key>
28
- <string>ios-arm64</string>
25
+ <string>ios-arm64_x86_64-simulator</string>
29
26
  <key>LibraryPath</key>
30
27
  <string>DavoiceTTS.framework</string>
31
28
  <key>SupportedArchitectures</key>
32
29
  <array>
33
30
  <string>arm64</string>
31
+ <string>x86_64</string>
34
32
  </array>
35
33
  <key>SupportedPlatform</key>
36
34
  <string>ios</string>
35
+ <key>SupportedPlatformVariant</key>
36
+ <string>simulator</string>
37
37
  </dict>
38
38
  </array>
39
39
  <key>CFBundlePackageType</key>
@@ -365,6 +365,7 @@ SWIFT_CLASS("_TtC10DavoiceTTS3STT")
365
365
  @property (nonatomic) BOOL continuous;
366
366
  @property (nonatomic) BOOL aecEnabled;
367
367
  @property (nonatomic) BOOL force16kMicSampleRate;
368
+ @property (nonatomic) BOOL useOSDefaultSamplingRate;
368
369
  @property (nonatomic) BOOL useLegacySpeakerGateBehavior;
369
370
  @property (nonatomic) BOOL useSpeakerGateHangover;
370
371
  @property (nonatomic) double speakerGateHangoverSeconds;