react-native-davoice-tts 1.0.254 → 1.0.256

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 (22) 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 +26 -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/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +1728 -1728
  9. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +12 -12
  10. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftinterface +12 -12
  11. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/DavoiceTTS +0 -0
  12. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +3005 -3005
  13. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +12 -12
  14. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface +12 -12
  15. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +3005 -3005
  16. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +12 -12
  17. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +12 -12
  18. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeDirectory +0 -0
  19. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeRequirements-1 +0 -0
  20. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeResources +24 -24
  21. package/package.json +1 -1
  22. package/speech/index.ts +48 -15
@@ -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.127" # Update to your package version
5
+ s.version = "1.0.129" # 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
- 6a8bf12923632e78bbe46c63184219ed tts-1.0.0.aar
1
+ 7686ba29355fc01a6c6f7faa16cbd58c tts-1.0.0.aar
@@ -1 +1 @@
1
- 05786702d93aff883200c954d9ed8370a6b5d5e9 tts-1.0.0.aar
1
+ 373b9581501382fa52186f155bb38edfe5b16baf tts-1.0.0.aar
@@ -60,13 +60,34 @@ public class DaVoiceTTSBridge extends ReactContextBaseJavaModule {
60
60
  }
61
61
  final String modelPathOrURL = config.getString("model");
62
62
 
63
- // Resolve model exactly like playWav (asset:/, file://, http(s) -> local cached file)
64
- final File modelFile = resolveToLocalFileForRead(modelPathOrURL, "onnx");
65
- if (modelFile == null || !modelFile.exists()) {
66
- promise.reject("model_missing", "Model file missing/unresolvable: " + modelPathOrURL);
63
+ // FIX: keep old behavior for plain asset-relative paths like "model.onnx" or "models/model.onnx"
64
+ // (i.e. files you manually put under android/app/src/main/assets or any merged asset pack).
65
+ final String s = (modelPathOrURL == null) ? "" : modelPathOrURL.trim();
66
+ if (s.isEmpty()) {
67
+ promise.reject("invalid_config", "Empty 'model'");
67
68
  return;
68
69
  }
69
- final String modelName = modelFile.getAbsolutePath();
70
+
71
+ final boolean looksLikePlainAssetPath =
72
+ !s.contains("://") &&
73
+ !s.startsWith("/") &&
74
+ !s.toLowerCase(Locale.US).startsWith("file:") &&
75
+ !s.toLowerCase(Locale.US).startsWith("content:") &&
76
+ !s.toLowerCase(Locale.US).startsWith("asset:");
77
+
78
+ final String modelName;
79
+ if (looksLikePlainAssetPath) {
80
+ // PASS THROUGH (old working behavior)
81
+ modelName = s;
82
+ } else {
83
+ // Resolve model like playWav (asset:/, file://, http(s) -> local cached file)
84
+ final File modelFile = resolveToLocalFileForRead(s, "onnx");
85
+ if (modelFile == null || !modelFile.exists()) {
86
+ promise.reject("model_missing", "Model file missing/unresolvable: " + s);
87
+ return;
88
+ }
89
+ modelName = modelFile.getAbsolutePath();
90
+ }
70
91
 
71
92
  // fire RN event when the last utterance finishes
72
93
  tts.setOnFinishedSpeakingListenerJava(() -> sendEvent("onFinishedSpeaking", null));
@@ -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</string>
11
+ <string>ios-arm64_x86_64-simulator</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>
17
18
  </array>
18
19
  <key>SupportedPlatform</key>
19
20
  <string>ios</string>
21
+ <key>SupportedPlatformVariant</key>
22
+ <string>simulator</string>
20
23
  </dict>
21
24
  <dict>
22
25
  <key>BinaryPath</key>
23
26
  <string>DavoiceTTS.framework/DavoiceTTS</string>
24
27
  <key>LibraryIdentifier</key>
25
- <string>ios-arm64_x86_64-simulator</string>
28
+ <string>ios-arm64</string>
26
29
  <key>LibraryPath</key>
27
30
  <string>DavoiceTTS.framework</string>
28
31
  <key>SupportedArchitectures</key>
29
32
  <array>
30
33
  <string>arm64</string>
31
- <string>x86_64</string>
32
34
  </array>
33
35
  <key>SupportedPlatform</key>
34
36
  <string>ios</string>
35
- <key>SupportedPlatformVariant</key>
36
- <string>simulator</string>
37
37
  </dict>
38
38
  </array>
39
39
  <key>CFBundlePackageType</key>