react-native-davoice 1.0.99 → 1.0.101
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/TTSRNBridge.podspec +1 -1
- 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/ios/TTSRNBridge/DavoiceTTS.xcframework/Info.plist +5 -5
- package/package.json +1 -1
- package/speech/index.ts +37 -8
package/TTSRNBridge.podspec
CHANGED
|
@@ -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.
|
|
5
|
+
s.version = "1.0.371" # 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 .
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
fba12514d87f6231fee1eddad738dd2b tts-1.0.0.aar
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
d7f21c893b9f953908b443a387d7b9a2175cbe59 tts-1.0.0.aar
|
|
@@ -8,32 +8,32 @@
|
|
|
8
8
|
<key>BinaryPath</key>
|
|
9
9
|
<string>DavoiceTTS.framework/DavoiceTTS</string>
|
|
10
10
|
<key>LibraryIdentifier</key>
|
|
11
|
-
<string>ios-
|
|
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-
|
|
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>
|
package/package.json
CHANGED
package/speech/index.ts
CHANGED
|
@@ -918,12 +918,15 @@ class Speech {
|
|
|
918
918
|
times: number,
|
|
919
919
|
preFetchMs: number = 0,
|
|
920
920
|
timeoutMs: number = 500,
|
|
921
|
-
): Promise<
|
|
921
|
+
): Promise<{ ok: boolean; reason: string; elapsedMs: number } | undefined> {
|
|
922
922
|
this.logCall('unPauseSpeechRecognitionLite', { times, preFetchMs });
|
|
923
923
|
const startedAt = Date.now();
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
924
|
+
// Previously hard-capped at 500ms regardless of the caller's requested timeoutMs, so the
|
|
925
|
+
// native "did the tap actually start" watchdog almost always gave up before the tap arrived
|
|
926
|
+
// (observed device timings are commonly 500-1000ms+), making result.ok:false noise rather
|
|
927
|
+
// than a meaningful signal. Respect the caller's timeout instead so the watchdog gets a
|
|
928
|
+
// realistic window to confirm the recognizer actually started.
|
|
929
|
+
const effectiveTimeoutMs = Number.isFinite(timeoutMs) && timeoutMs > 0 ? timeoutMs : 500;
|
|
927
930
|
|
|
928
931
|
const mod: any = Platform.OS === 'ios' ? NativeSpeech : NativeSTT;
|
|
929
932
|
const fn = mod?.unPauseSpeechRecognitionLite;
|
|
@@ -947,7 +950,16 @@ class Speech {
|
|
|
947
950
|
if (result?.ok === false) {
|
|
948
951
|
dbgNotice('IMPORTANT: unPauseSpeechRecognitionLiteAsync reached timeout - please note this is not a bug', result?.reason);
|
|
949
952
|
}
|
|
950
|
-
|
|
953
|
+
// Propagate the native verdict instead of swallowing it. Callers need to know when the
|
|
954
|
+
// native side could not confirm the recognizer actually started, otherwise a dead
|
|
955
|
+
// listening session is indistinguishable from a healthy one until a much later watchdog.
|
|
956
|
+
// ok defaults to true when the field is absent so bridge paths that do not report a
|
|
957
|
+
// verdict are not treated as failures.
|
|
958
|
+
return {
|
|
959
|
+
ok: result?.ok !== false,
|
|
960
|
+
reason: String(result?.reason ?? ''),
|
|
961
|
+
elapsedMs: Date.now() - startedAt,
|
|
962
|
+
};
|
|
951
963
|
}
|
|
952
964
|
|
|
953
965
|
if (Platform.OS === 'ios') {
|
|
@@ -992,11 +1004,11 @@ class Speech {
|
|
|
992
1004
|
|
|
993
1005
|
if (PROBABLY_GPT_MISTAKE) {
|
|
994
1006
|
const opId = nextSpeechOpId('unpause-stt');
|
|
995
|
-
await this.enqueueSttTransition(opId, 'unpause', () => work(opId));
|
|
996
|
-
return;
|
|
1007
|
+
await this.enqueueSttTransition(opId, 'unpause', () => work(opId).then(() => undefined));
|
|
1008
|
+
return undefined;
|
|
997
1009
|
}
|
|
998
1010
|
|
|
999
|
-
|
|
1011
|
+
return work();
|
|
1000
1012
|
}
|
|
1001
1013
|
/** Pause mic/STT (Android native; iOS unified if present) */
|
|
1002
1014
|
async pauseMicrophone(): Promise<void> {
|
|
@@ -1123,6 +1135,23 @@ class Speech {
|
|
|
1123
1135
|
}
|
|
1124
1136
|
}
|
|
1125
1137
|
|
|
1138
|
+
/**
|
|
1139
|
+
* Read-only view of the JS half of the event-delivery path. Pairs with the native
|
|
1140
|
+
* sttHealthSnapshot(): native reports whether it will emit (hasListeners), this reports
|
|
1141
|
+
* whether we are subscribed and to which emitter. rewireListenersForMode() tears all
|
|
1142
|
+
* subscriptions down and re-adds them, and ensureListeners() early-returns whenever
|
|
1143
|
+
* subs is non-empty, so a subscription attached to the wrong emitter is permanent.
|
|
1144
|
+
*/
|
|
1145
|
+
sttListenerDiag(): Record<string, any> {
|
|
1146
|
+
return {
|
|
1147
|
+
subsCount: this.subs.length,
|
|
1148
|
+
iosTtsOnly: this.iosTtsOnly,
|
|
1149
|
+
emitter: this.unifiedEmitter ? 'unified' : (this.sttEmitter ? 'stt' : 'none'),
|
|
1150
|
+
hasCompletedFullInit: this.hasCompletedFullInit,
|
|
1151
|
+
hasCompletedTtsInit: this.hasCompletedTtsInit,
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1126
1155
|
async hasIOSMicPermissions(): Promise<boolean> {
|
|
1127
1156
|
if (Platform.OS !== 'ios') return false;
|
|
1128
1157
|
if (!NativeSpeech?.hasMicPermissions) return false;
|