react-native-davoice 1.0.8 → 1.0.10
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/java/com/davoice/stt/rn/STTModule.kt +13 -0
- package/package.json +1 -1
- package/speech/index.ts +7 -2
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.194" # 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
|
+
42672253290af681c13e0c48a8ea05dd tts-1.0.0.aar
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
db50ab0dec3bc798242d72f812bf5d7b4f87ed0d tts-1.0.0.aar
|
|
@@ -138,6 +138,19 @@ class STTModule(private val rc: ReactApplicationContext)
|
|
|
138
138
|
cb.invoke(true)
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
@ReactMethod
|
|
142
|
+
fun unPauseSpeechRecognitionLiteWithPreFetch(times: Double, preFetchMs: Double, cb: Callback) {
|
|
143
|
+
if (stt == null) {
|
|
144
|
+
cb.invoke(true)
|
|
145
|
+
return
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
val t = times.toInt()
|
|
149
|
+
val ms = preFetchMs.toInt().coerceIn(0, 2000)
|
|
150
|
+
stt?.unPauseSpeechRecognitionLite(t, ms)
|
|
151
|
+
cb.invoke(true)
|
|
152
|
+
}
|
|
153
|
+
|
|
141
154
|
@ReactMethod
|
|
142
155
|
fun pauseMicrophone(cb: Callback) {
|
|
143
156
|
ensure().pauseMicrophone()
|
package/package.json
CHANGED
package/speech/index.ts
CHANGED
|
@@ -588,12 +588,17 @@ class Speech {
|
|
|
588
588
|
}
|
|
589
589
|
return new Promise<void>((resolve, reject) => {
|
|
590
590
|
try {
|
|
591
|
-
|
|
591
|
+
const done = async (ok: boolean) => {
|
|
592
592
|
if (!ok) dbgErr('unPauseSpeechRecognitionLite(times) returned false');
|
|
593
593
|
// ✅ ANDROID: small delay before resolving
|
|
594
594
|
if (Platform.OS === 'android') await sleep(500);
|
|
595
595
|
resolve();
|
|
596
|
-
}
|
|
596
|
+
};
|
|
597
|
+
if (Platform.OS === 'android' && preFetchMs > 0 && typeof mod?.unPauseSpeechRecognitionLiteWithPreFetch === 'function') {
|
|
598
|
+
mod.unPauseSpeechRecognitionLiteWithPreFetch(times, preFetchMs, done);
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
fn.call(mod, times, done);
|
|
597
602
|
} catch (e) {
|
|
598
603
|
reject(e as any);
|
|
599
604
|
}
|