react-native-davoice-tts 1.0.362 → 1.0.364
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.
- package/README.md +19 -0
- package/TTSRNBridge.podspec +1 -1
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar +0 -0
- package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar.md5 +1 -1
- package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar.sha1 +1 -1
- package/android/src/main/java/com/davoice/stt/rn/STTModule.kt +3 -1
- package/ios/SpeechBridge/SpeechBridge.m +3 -2
- package/ios/TTSRNBridge/DaVoiceTTSBridge.m +144 -3
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/DavoiceTTS +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +403 -368
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/DavoiceTTS +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +403 -368
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +403 -368
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeResources +12 -12
- package/package.json +1 -1
- package/speech/index.ts +22 -7
|
Binary file
|
|
Binary file
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</data>
|
|
15
15
|
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
16
16
|
<data>
|
|
17
|
-
|
|
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
|
-
|
|
33
|
+
mG5zpUzD0Dj71BTZ8Lvunb7lkbM=
|
|
34
34
|
</data>
|
|
35
35
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
36
36
|
<data>
|
|
37
|
-
|
|
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
|
-
|
|
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
|
-
|
|
77
|
+
ru7p+bUKnIS+HG5H0Pk4ci+5Jxg=
|
|
78
78
|
</data>
|
|
79
79
|
<key>hash2</key>
|
|
80
80
|
<data>
|
|
81
|
-
|
|
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
|
-
|
|
121
|
+
mG5zpUzD0Dj71BTZ8Lvunb7lkbM=
|
|
122
122
|
</data>
|
|
123
123
|
<key>hash2</key>
|
|
124
124
|
<data>
|
|
125
|
-
|
|
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
|
-
|
|
132
|
+
ru7p+bUKnIS+HG5H0Pk4ci+5Jxg=
|
|
133
133
|
</data>
|
|
134
134
|
<key>hash2</key>
|
|
135
135
|
<data>
|
|
136
|
-
|
|
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
|
-
|
|
176
|
+
UukBUaorNvJ3swwENgV9QE64egI=
|
|
177
177
|
</data>
|
|
178
178
|
<key>hash2</key>
|
|
179
179
|
<data>
|
|
180
|
-
|
|
180
|
+
DrzWlfpisKxpcKHvEzqlPqWvhtauis/mAk5jMK5SZLk=
|
|
181
181
|
</data>
|
|
182
182
|
</dict>
|
|
183
183
|
<key>Modules/module.modulemap</key>
|
package/package.json
CHANGED
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
|
-
//
|
|
608
|
-
//
|
|
609
|
-
if (
|
|
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.');
|