react-native-davoice-tts 1.0.285 → 1.0.286
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
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.159" # 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 .
|
|
@@ -39,9 +39,19 @@ class STTModule(private val rc: ReactApplicationContext)
|
|
|
39
39
|
// ANDROID expects (locale, options, callback) like @react-native-voice
|
|
40
40
|
@ReactMethod
|
|
41
41
|
fun startSpeech(locale: String?, options: ReadableMap, cb: Callback) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
var onboardingJson: String? = null
|
|
43
|
+
try {
|
|
44
|
+
if (options.hasKey("onboardingJsonPath") && !options.isNull("onboardingJsonPath")) {
|
|
45
|
+
val p = options.getString("onboardingJsonPath")
|
|
46
|
+
if (!p.isNullOrBlank()) {
|
|
47
|
+
onboardingJson = java.io.File(p).readText(Charsets.UTF_8)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
} catch (_: Throwable) {
|
|
51
|
+
onboardingJson = null
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
ensure().startSpeech(locale, onboardingJson, null)
|
|
45
55
|
cb.invoke(false) // parity with voice: callback(false) on success
|
|
46
56
|
}
|
|
47
57
|
|
package/package.json
CHANGED
package/speech/index.ts
CHANGED