react-native-davoice-tts 1.0.363 → 1.0.365

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/README.md +19 -0
  2. package/TTSRNBridge.podspec +1 -1
  3. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  4. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  5. package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar +0 -0
  6. package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar.md5 +1 -1
  7. package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar.sha1 +1 -1
  8. package/android/src/main/java/com/davoice/stt/rn/STTModule.kt +3 -1
  9. package/ios/SpeechBridge/SpeechBridge.m +3 -2
  10. package/ios/TTSRNBridge/DaVoiceTTSBridge.m +144 -3
  11. package/ios/TTSRNBridge/DavoiceTTS.xcframework/Info.plist +5 -5
  12. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/DavoiceTTS +0 -0
  13. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +250 -215
  14. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/DavoiceTTS +0 -0
  15. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +250 -215
  16. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +250 -215
  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 +12 -12
  20. package/package.json +1 -1
  21. package/speech/index.ts +22 -7
@@ -14,7 +14,7 @@
14
14
  </data>
15
15
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
16
16
  <data>
17
- 0pcqJnfEm6vr2xxeUp81dnZvTZA=
17
+ ru7p+bUKnIS+HG5H0Pk4ci+5Jxg=
18
18
  </data>
19
19
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
20
20
  <data>
@@ -30,11 +30,11 @@
30
30
  </data>
31
31
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
32
32
  <data>
33
- qmncmjuy20dygAbzaIvVP93l9nk=
33
+ mG5zpUzD0Dj71BTZ8Lvunb7lkbM=
34
34
  </data>
35
35
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
36
36
  <data>
37
- 0pcqJnfEm6vr2xxeUp81dnZvTZA=
37
+ ru7p+bUKnIS+HG5H0Pk4ci+5Jxg=
38
38
  </data>
39
39
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
40
40
  <data>
@@ -50,7 +50,7 @@
50
50
  </data>
51
51
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
52
52
  <data>
53
- YRZ75+P0EHViII7ERsflcEQq6Xc=
53
+ UukBUaorNvJ3swwENgV9QE64egI=
54
54
  </data>
55
55
  <key>Modules/module.modulemap</key>
56
56
  <data>
@@ -74,11 +74,11 @@
74
74
  <dict>
75
75
  <key>hash</key>
76
76
  <data>
77
- 0pcqJnfEm6vr2xxeUp81dnZvTZA=
77
+ ru7p+bUKnIS+HG5H0Pk4ci+5Jxg=
78
78
  </data>
79
79
  <key>hash2</key>
80
80
  <data>
81
- kmfen2dZw95BkxWhN05FfJEZ0wp0YUJGCdiXRtrFFn8=
81
+ jDpKOzrNa5k/cHoG7rjXaJsi6TNjU6jd/SQWSe/FrAY=
82
82
  </data>
83
83
  </dict>
84
84
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
@@ -118,22 +118,22 @@
118
118
  <dict>
119
119
  <key>hash</key>
120
120
  <data>
121
- qmncmjuy20dygAbzaIvVP93l9nk=
121
+ mG5zpUzD0Dj71BTZ8Lvunb7lkbM=
122
122
  </data>
123
123
  <key>hash2</key>
124
124
  <data>
125
- CSVoiG5uwKnCsvhVrhqvj/gZdCUTaHoTNa+hNDaTeB0=
125
+ 5rkxfeXBgmtWNUJKirhDCCabcOxhlPoY8cY1GzYuUag=
126
126
  </data>
127
127
  </dict>
128
128
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
129
129
  <dict>
130
130
  <key>hash</key>
131
131
  <data>
132
- 0pcqJnfEm6vr2xxeUp81dnZvTZA=
132
+ ru7p+bUKnIS+HG5H0Pk4ci+5Jxg=
133
133
  </data>
134
134
  <key>hash2</key>
135
135
  <data>
136
- kmfen2dZw95BkxWhN05FfJEZ0wp0YUJGCdiXRtrFFn8=
136
+ jDpKOzrNa5k/cHoG7rjXaJsi6TNjU6jd/SQWSe/FrAY=
137
137
  </data>
138
138
  </dict>
139
139
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
@@ -173,11 +173,11 @@
173
173
  <dict>
174
174
  <key>hash</key>
175
175
  <data>
176
- YRZ75+P0EHViII7ERsflcEQq6Xc=
176
+ UukBUaorNvJ3swwENgV9QE64egI=
177
177
  </data>
178
178
  <key>hash2</key>
179
179
  <data>
180
- 0B2IE6WcPcOrtMHmR7gw8L2qPpokOugtuwJ2id0D0VQ=
180
+ DrzWlfpisKxpcKHvEzqlPqWvhtauis/mAk5jMK5SZLk=
181
181
  </data>
182
182
  </dict>
183
183
  <key>Modules/module.modulemap</key>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-davoice-tts",
3
- "version": "1.0.363",
3
+ "version": "1.0.365",
4
4
  "description": "tts library for React Native",
5
5
  "main": "tts/index.js",
6
6
  "types": "tts/index.d.ts",
package/speech/index.ts CHANGED
@@ -160,6 +160,11 @@ export type AudioRoutingConfig = {
160
160
  */
161
161
  msBeforeUnduck?: number;
162
162
  };
163
+ /** Temporary wake-word sensitivity used only while physical TTS audio plays. */
164
+ wakeWordDuringTTS?: {
165
+ threshold: number;
166
+ buffer_cnt: number;
167
+ };
163
168
  };
164
169
 
165
170
  export type UnifiedEvents = {
@@ -556,6 +561,15 @@ class Speech {
556
561
  throw new Error('Missing native bridges (STT/TTS).');
557
562
  }
558
563
 
564
+ // Android can transition from standalone initTTS() to initAll(). Dispose
565
+ // the standalone engine before constructing the unified STT + TTS state;
566
+ // otherwise the subsequent native initTTS() replaces its reference without
567
+ // explicitly releasing the previous ONNX/playback resources.
568
+ if (Platform.OS === 'android' && this.hasCompletedTtsInit && !this.hasCompletedFullInit) {
569
+ try { await NativeTTS.destroy?.(); } catch {}
570
+ this.hasCompletedTtsInit = false;
571
+ }
572
+
559
573
  // Start STT (best-effort; no-op if already running)
560
574
  await new Promise<void>((resolve, reject) => {
561
575
  try {
@@ -604,9 +618,9 @@ class Speech {
604
618
  this.ttsChain = Promise.resolve();
605
619
  this.wavChain = Promise.resolve();
606
620
 
607
- // iOS TTS-only mode: initTTS() used the standalone TTS bridge, so do not
608
- // tear down SpeechBridge/STT state that was never started by this path.
609
- if (Platform.OS === 'ios' && this.iosTtsOnly && !this.hasCompletedFullInit) {
621
+ // initTTS() uses only the standalone TTS bridge on both platforms. Do not
622
+ // touch STT during cleanup when this instance never ran initAll().
623
+ if (this.hasCompletedTtsInit && !this.hasCompletedFullInit) {
610
624
  try { await NativeTTS?.destroy?.(); } catch {}
611
625
  this.hasCompletedTtsInit = false;
612
626
  this.iosTtsOnly = false;
@@ -1118,8 +1132,9 @@ class Speech {
1118
1132
  }
1119
1133
  if (!NativeTTS?.initTTS) throw new Error('Native TTS module missing initTTS()');
1120
1134
  const modelPath = this.resolveModelToPath(cfg.model);
1135
+ const modelExt = this.resolveModelExt(cfg.model);
1121
1136
  this.lastModel = modelPath;
1122
- const r = await NativeTTS.initTTS({ model: modelPath });
1137
+ const r = await NativeTTS.initTTS({ model: modelPath, modelExt });
1123
1138
  this.hasCompletedTtsInit = true;
1124
1139
  if (Platform.OS === 'ios' && !this.hasCompletedFullInit) {
1125
1140
  this.iosTtsOnly = true;
@@ -1201,7 +1216,7 @@ class Speech {
1201
1216
 
1202
1217
  try {
1203
1218
  // Prefer unified iOS bridge if present
1204
- if (Platform.OS === 'ios' && NativeSpeech?.playWav) {
1219
+ if (Platform.OS === 'ios' && !this.iosTtsOnly && NativeSpeech?.playWav) {
1205
1220
  (NativeSpeech as any).playWav(realPath, markAsLast);
1206
1221
  return;
1207
1222
  }
@@ -1248,7 +1263,7 @@ class Speech {
1248
1263
  }
1249
1264
 
1250
1265
  // Fire-and-forget (cannot await because native will not emit completion)
1251
- if (Platform.OS === 'ios' && NativeSpeech?.playWav) {
1266
+ if (Platform.OS === 'ios' && !this.iosTtsOnly && NativeSpeech?.playWav) {
1252
1267
  return (NativeSpeech as any).playWav(realPath, false);
1253
1268
  }
1254
1269
 
@@ -1333,7 +1348,7 @@ class Speech {
1333
1348
  format: desc.format,
1334
1349
  markAsLast: desc.markAsLast ?? true,
1335
1350
  };
1336
- if (Platform.OS === 'ios' && NativeSpeech?.playBuffer) {
1351
+ if (Platform.OS === 'ios' && !this.iosTtsOnly && NativeSpeech?.playBuffer) {
1337
1352
  return NativeSpeech.playBuffer(payload);
1338
1353
  }
1339
1354
  if (!NativeTTS?.playBuffer) throw new Error('playBuffer not available on this platform.');