react-native-davoice-tts 1.0.7 → 1.0.9
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/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/tts/rn/DaVoiceTTSBridge.java +13 -5
- package/package.json +1 -1
- package/tts/DaVoiceTTSBridge.d.ts +1 -1
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
000421e906a1204cc96c96ee7e901737 tts-1.0.0.aar
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
8d9b848535ad51fd12426be1f22d01065c3a9e90 tts-1.0.0.aar
|
|
@@ -5,6 +5,7 @@ import com.facebook.react.bridge.Promise;
|
|
|
5
5
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
6
6
|
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
7
7
|
import com.facebook.react.bridge.ReactMethod;
|
|
8
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Minimal RN bridge:
|
|
@@ -28,14 +29,21 @@ public class DaVoiceTTSBridge extends ReactContextBaseJavaModule {
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
@ReactMethod
|
|
31
|
-
public void initTTS(
|
|
32
|
+
public void initTTS(ReadableMap config, Promise promise) {
|
|
32
33
|
try {
|
|
33
|
-
|
|
34
|
+
if (config == null || !config.hasKey("model") || config.isNull("model")) {
|
|
35
|
+
promise.reject("invalid_config", "Missing required 'model' key");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
final String modelName = config.getString("model");
|
|
39
|
+
// AAR handles the rest (tokens=<model>.json, espeak dir, etc.)
|
|
34
40
|
DaVoiceTTSInterface.Config cfg = new DaVoiceTTSInterface.Config(
|
|
35
|
-
modelName, // e.g
|
|
36
|
-
"en-US", // default voice
|
|
37
|
-
"phonemes_dir" // asset dir name
|
|
41
|
+
modelName, // e.g. "model.onnx"
|
|
42
|
+
"en-US", // default voice (ignored/overridden by AAR if needed)
|
|
43
|
+
"phonemes_dir" // asset dir name (AAR copies recursively)
|
|
38
44
|
);
|
|
45
|
+
|
|
46
|
+
|
|
39
47
|
boolean ok = tts.initTTS(cfg);
|
|
40
48
|
if (!ok) {
|
|
41
49
|
promise.reject("InitFailed", "Engine/TTS init failed");
|
package/package.json
CHANGED