react-native-davoice-tts 1.0.368 → 1.0.370
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/android/src/main/libs/MyLibrary-release.aar +0 -0
- package/ios/SpeechBridge/SpeechBridge.m +8 -8
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/Info.plist +5 -5
- 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 +46 -39
- 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 +46 -39
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +46 -39
- 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 +41 -26
|
@@ -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
|
+
4d0CILI6veOSh30xOqrDveyG2N8=
|
|
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
|
+
rlWKpk/s8nwudSgVnYRfhJi1R9k=
|
|
34
34
|
</data>
|
|
35
35
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
36
36
|
<data>
|
|
37
|
-
|
|
37
|
+
4d0CILI6veOSh30xOqrDveyG2N8=
|
|
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
|
+
No4X7m4Waw4bgAy8RjHEJEbK54s=
|
|
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
|
+
4d0CILI6veOSh30xOqrDveyG2N8=
|
|
78
78
|
</data>
|
|
79
79
|
<key>hash2</key>
|
|
80
80
|
<data>
|
|
81
|
-
|
|
81
|
+
XOqvHSeO8f4yhzkgQk/GhsdLcV7igmVTomB6CHlGsb0=
|
|
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
|
+
rlWKpk/s8nwudSgVnYRfhJi1R9k=
|
|
122
122
|
</data>
|
|
123
123
|
<key>hash2</key>
|
|
124
124
|
<data>
|
|
125
|
-
|
|
125
|
+
N9xYj2Pei0WH1Q6uGyb8ooG7XqGx/EU2YLFZ6Ep1uXU=
|
|
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
|
+
4d0CILI6veOSh30xOqrDveyG2N8=
|
|
133
133
|
</data>
|
|
134
134
|
<key>hash2</key>
|
|
135
135
|
<data>
|
|
136
|
-
|
|
136
|
+
XOqvHSeO8f4yhzkgQk/GhsdLcV7igmVTomB6CHlGsb0=
|
|
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
|
+
No4X7m4Waw4bgAy8RjHEJEbK54s=
|
|
177
177
|
</data>
|
|
178
178
|
<key>hash2</key>
|
|
179
179
|
<data>
|
|
180
|
-
|
|
180
|
+
JpvXwReKm1xWQM2dEtmdx9fWlRc4rFiIgiSX133FmlM=
|
|
181
181
|
</data>
|
|
182
182
|
</dict>
|
|
183
183
|
<key>Modules/module.modulemap</key>
|
package/package.json
CHANGED
package/speech/index.ts
CHANGED
|
@@ -21,6 +21,11 @@ function dbgErr(...args: any[]) {
|
|
|
21
21
|
// eslint-disable-next-line no-console
|
|
22
22
|
console.error(ts(), PFX, '❌', ...args);
|
|
23
23
|
}
|
|
24
|
+
function dbgNotice(...args: any[]) {
|
|
25
|
+
// Pause/unpause timeouts are bounded control-flow outcomes, not errors.
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
console.log(ts(), PFX, 'ℹ️', ...args);
|
|
28
|
+
}
|
|
24
29
|
|
|
25
30
|
function safeJson(x: any) {
|
|
26
31
|
try {
|
|
@@ -50,7 +55,7 @@ function androidCallbackWithTimeout<T>(
|
|
|
50
55
|
const timer = setTimeout(() => {
|
|
51
56
|
if (settled) return;
|
|
52
57
|
settled = true;
|
|
53
|
-
|
|
58
|
+
dbgNotice(`IMPORTANT: ${label} reached timeout - please note this is not a bug`, { timeoutMs });
|
|
54
59
|
resolve(undefined);
|
|
55
60
|
}, timeoutMs);
|
|
56
61
|
try {
|
|
@@ -831,12 +836,15 @@ class Speech {
|
|
|
831
836
|
return this.start(locale);
|
|
832
837
|
}
|
|
833
838
|
|
|
834
|
-
// Android: native pauseSpeechRecognitionLite is now bounded internally (~
|
|
839
|
+
// Android: native pauseSpeechRecognitionLite is now bounded internally (~500ms, see
|
|
835
840
|
// STT.kt runPauseResumeSerializedOnMain), so this timeout is a backstop, not the
|
|
836
841
|
// primary fix - it guarantees this promise settles even if the bridge itself stalls.
|
|
837
|
-
async pauseSpeechRecognition(timeoutMs: number =
|
|
842
|
+
async pauseSpeechRecognition(timeoutMs: number = 500): Promise<void> {
|
|
838
843
|
this.logCall('pauseSpeechRecognitionLite');
|
|
839
844
|
const startedAt = Date.now();
|
|
845
|
+
const effectiveTimeoutMs = Number.isFinite(timeoutMs) && timeoutMs > 0
|
|
846
|
+
? Math.min(timeoutMs, 500)
|
|
847
|
+
: 500;
|
|
840
848
|
|
|
841
849
|
const mod: any = Platform.OS === 'ios' ? NativeSpeech : NativeSTT;
|
|
842
850
|
const fn = mod?.pauseSpeechRecognitionLite;
|
|
@@ -848,17 +856,19 @@ class Speech {
|
|
|
848
856
|
}
|
|
849
857
|
|
|
850
858
|
if (Platform.OS === 'ios' && typeof mod?.pauseSpeechRecognitionLiteAsync === 'function') {
|
|
851
|
-
dbg('[pauseSpeechRecognitionLiteAsync] begin', { ...(opId ? { opId } : {}), timeoutMs:
|
|
852
|
-
const result = await mod.pauseSpeechRecognitionLiteAsync(
|
|
859
|
+
dbg('[pauseSpeechRecognitionLiteAsync] begin', { ...(opId ? { opId } : {}), timeoutMs: 500 });
|
|
860
|
+
const result = await mod.pauseSpeechRecognitionLiteAsync(500);
|
|
853
861
|
dbg('[pauseSpeechRecognitionLiteAsync] resolved', { ...(opId ? { opId } : {}), elapsedMs: Date.now() - startedAt, result });
|
|
854
|
-
if (result?.ok === false)
|
|
862
|
+
if (result?.ok === false) {
|
|
863
|
+
dbgNotice('IMPORTANT: pauseSpeechRecognitionLiteAsync reached timeout - please note this is not a bug', result?.reason);
|
|
864
|
+
}
|
|
855
865
|
return;
|
|
856
866
|
}
|
|
857
867
|
if (Platform.OS === 'ios') {
|
|
858
868
|
await new Promise<void>((resolve, reject) => {
|
|
859
869
|
try {
|
|
860
870
|
fn.call(mod, (ok: boolean) => {
|
|
861
|
-
if (!ok)
|
|
871
|
+
if (!ok) dbgNotice('IMPORTANT: pauseSpeechRecognitionLite reached timeout - please note this is not a bug');
|
|
862
872
|
resolve();
|
|
863
873
|
});
|
|
864
874
|
} catch (e) {
|
|
@@ -870,14 +880,12 @@ class Speech {
|
|
|
870
880
|
|
|
871
881
|
await androidCallbackWithTimeout<void>(
|
|
872
882
|
(done) => {
|
|
873
|
-
fn.call(mod,
|
|
874
|
-
if (!ok)
|
|
875
|
-
// ✅ ANDROID: small delay before resolving
|
|
876
|
-
if (Platform.OS === 'android') await sleep(500);
|
|
883
|
+
fn.call(mod, (ok: boolean) => {
|
|
884
|
+
if (!ok) dbgNotice('IMPORTANT: pauseSpeechRecognitionLite reached timeout - please note this is not a bug');
|
|
877
885
|
done(undefined);
|
|
878
886
|
});
|
|
879
887
|
},
|
|
880
|
-
|
|
888
|
+
effectiveTimeoutMs,
|
|
881
889
|
'pauseSpeechRecognitionLite',
|
|
882
890
|
);
|
|
883
891
|
};
|
|
@@ -894,10 +902,13 @@ class Speech {
|
|
|
894
902
|
async unPauseSpeechRecognition(
|
|
895
903
|
times: number,
|
|
896
904
|
preFetchMs: number = 0,
|
|
897
|
-
timeoutMs: number =
|
|
905
|
+
timeoutMs: number = 500,
|
|
898
906
|
): Promise<void> {
|
|
899
907
|
this.logCall('unPauseSpeechRecognitionLite', { times, preFetchMs });
|
|
900
908
|
const startedAt = Date.now();
|
|
909
|
+
const effectiveTimeoutMs = Number.isFinite(timeoutMs) && timeoutMs > 0
|
|
910
|
+
? Math.min(timeoutMs, 500)
|
|
911
|
+
: 500;
|
|
901
912
|
|
|
902
913
|
const mod: any = Platform.OS === 'ios' ? NativeSpeech : NativeSTT;
|
|
903
914
|
const fn = mod?.unPauseSpeechRecognitionLite;
|
|
@@ -909,8 +920,8 @@ class Speech {
|
|
|
909
920
|
}
|
|
910
921
|
|
|
911
922
|
if (Platform.OS === 'ios' && typeof mod?.unPauseSpeechRecognitionLiteAsync === 'function') {
|
|
912
|
-
dbg('[unPauseSpeechRecognitionLiteAsync] begin', { ...(opId ? { opId } : {}), times, preFetchMs, timeoutMs });
|
|
913
|
-
const result = await mod.unPauseSpeechRecognitionLiteAsync(times, preFetchMs,
|
|
923
|
+
dbg('[unPauseSpeechRecognitionLiteAsync] begin', { ...(opId ? { opId } : {}), times, preFetchMs, timeoutMs: effectiveTimeoutMs });
|
|
924
|
+
const result = await mod.unPauseSpeechRecognitionLiteAsync(times, preFetchMs, effectiveTimeoutMs);
|
|
914
925
|
dbg('[unPauseSpeechRecognitionLiteAsync] resolved', {
|
|
915
926
|
...(opId ? { opId } : {}),
|
|
916
927
|
times,
|
|
@@ -918,7 +929,9 @@ class Speech {
|
|
|
918
929
|
elapsedMs: Date.now() - startedAt,
|
|
919
930
|
result,
|
|
920
931
|
});
|
|
921
|
-
if (result?.ok === false)
|
|
932
|
+
if (result?.ok === false) {
|
|
933
|
+
dbgNotice('IMPORTANT: unPauseSpeechRecognitionLiteAsync reached timeout - please note this is not a bug', result?.reason);
|
|
934
|
+
}
|
|
922
935
|
return;
|
|
923
936
|
}
|
|
924
937
|
|
|
@@ -926,7 +939,7 @@ class Speech {
|
|
|
926
939
|
await new Promise<void>((resolve, reject) => {
|
|
927
940
|
try {
|
|
928
941
|
const done = (ok: boolean) => {
|
|
929
|
-
if (!ok)
|
|
942
|
+
if (!ok) dbgNotice('IMPORTANT: unPauseSpeechRecognitionLite reached timeout - please note this is not a bug');
|
|
930
943
|
dbg('[CALL unPauseSpeechRecognitionLite] native callback fired', { times, preFetchMs, ok });
|
|
931
944
|
resolve();
|
|
932
945
|
};
|
|
@@ -947,10 +960,8 @@ class Speech {
|
|
|
947
960
|
}
|
|
948
961
|
await androidCallbackWithTimeout<void>(
|
|
949
962
|
(done) => {
|
|
950
|
-
const nativeDone =
|
|
951
|
-
if (!ok)
|
|
952
|
-
// ✅ ANDROID: small delay before resolving
|
|
953
|
-
if (Platform.OS === 'android') await sleep(500);
|
|
963
|
+
const nativeDone = (ok: boolean) => {
|
|
964
|
+
if (!ok) dbgNotice('IMPORTANT: unPauseSpeechRecognitionLite reached timeout - please note this is not a bug');
|
|
954
965
|
done(undefined);
|
|
955
966
|
};
|
|
956
967
|
if (Platform.OS === 'android' && preFetchMs > 0 && typeof mod?.unPauseSpeechRecognitionLiteWithPreFetch === 'function') {
|
|
@@ -959,7 +970,7 @@ class Speech {
|
|
|
959
970
|
}
|
|
960
971
|
fn.call(mod, times, nativeDone);
|
|
961
972
|
},
|
|
962
|
-
|
|
973
|
+
effectiveTimeoutMs,
|
|
963
974
|
'unPauseSpeechRecognitionLite',
|
|
964
975
|
);
|
|
965
976
|
};
|
|
@@ -980,9 +991,11 @@ class Speech {
|
|
|
980
991
|
if (Platform.OS === 'ios' && (NativeSpeech as any)?.pauseMicrophoneAsync) {
|
|
981
992
|
dbg('IOS [pauseMicrophone] using NativeSpeech.pauseMicrophoneAsync()');
|
|
982
993
|
try {
|
|
983
|
-
const r = await (NativeSpeech as any).pauseMicrophoneAsync(
|
|
994
|
+
const r = await (NativeSpeech as any).pauseMicrophoneAsync(500);
|
|
984
995
|
dbg('pauseMicrophoneAsync result', r);
|
|
985
|
-
if (r?.ok === false)
|
|
996
|
+
if (r?.ok === false) {
|
|
997
|
+
dbgNotice('IMPORTANT: pauseMicrophoneAsync reached timeout - please note this is not a bug', r?.reason);
|
|
998
|
+
}
|
|
986
999
|
return;
|
|
987
1000
|
} catch (e) {
|
|
988
1001
|
dbgErr('IOS [pauseMicrophone] NativeSpeech.pauseMicrophoneAsync() ERROR:', String(e));
|
|
@@ -1010,8 +1023,10 @@ class Speech {
|
|
|
1010
1023
|
if (Platform.OS === 'ios' && (NativeSpeech as any)?.unPauseMicrophoneAsync) {
|
|
1011
1024
|
dbg('IOS [unPauseMicrophone] using NativeSpeech.unPauseMicrophoneAsync()');
|
|
1012
1025
|
try {
|
|
1013
|
-
const r = await (NativeSpeech as any).unPauseMicrophoneAsync(
|
|
1014
|
-
if (r?.ok === false)
|
|
1026
|
+
const r = await (NativeSpeech as any).unPauseMicrophoneAsync(500);
|
|
1027
|
+
if (r?.ok === false) {
|
|
1028
|
+
dbgNotice('IMPORTANT: unPauseMicrophoneAsync reached timeout - please note this is not a bug', r?.reason);
|
|
1029
|
+
}
|
|
1015
1030
|
dbg('IOS [unPauseMicrophone] NativeSpeech.unPauseMicrophoneAsync() DONE');
|
|
1016
1031
|
return;
|
|
1017
1032
|
} catch (e) {
|