react-native-davoice-tts 1.0.345 → 1.0.347
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 +3 -0
- package/ios/TTSRNBridge/DaVoiceTTSBridge.m +24 -1
- 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 +8276 -8256
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +57 -57
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftinterface +57 -57
- 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 +5766 -5746
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +63 -63
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface +63 -63
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +5766 -5746
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +63 -63
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +63 -63
- 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 +24 -24
- package/package.json +1 -1
- package/speech/index.ts +86 -18
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.249" # 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
|
+
bd97a4af4a770e3cc8f004ed838378bc tts-1.0.0.aar
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
d6f35be0cf970cfafd23ef6ab3283b98ea8b9458 tts-1.0.0.aar
|
|
@@ -6,6 +6,7 @@ import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
|
6
6
|
import com.davoice.stt.STT
|
|
7
7
|
import com.davoice.stt.STTDelegate
|
|
8
8
|
import com.davoice.tts.LicenseManager
|
|
9
|
+
import android.util.Log
|
|
9
10
|
|
|
10
11
|
@ReactModule(name = STTModule.NAME)
|
|
11
12
|
class STTModule(private val rc: ReactApplicationContext)
|
|
@@ -22,6 +23,7 @@ class STTModule(private val rc: ReactApplicationContext)
|
|
|
22
23
|
@ReactMethod fun removeListeners(count: Double) {}
|
|
23
24
|
|
|
24
25
|
private fun send(name: String, body: WritableMap? = null) {
|
|
26
|
+
Log.w("STTModule", "[RNDBG] emitting $name to JS")
|
|
25
27
|
rc.runOnUiQueueThread {
|
|
26
28
|
rc.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
27
29
|
.emit(name, body)
|
|
@@ -225,6 +227,7 @@ class STTModule(private val rc: ReactApplicationContext)
|
|
|
225
227
|
}
|
|
226
228
|
|
|
227
229
|
override fun onSpeechPartialResults(list: List<String>) {
|
|
230
|
+
Log.w("STTModule", "[RNDBG] onSpeechPartialResults delegate reached size=${list.size}")
|
|
228
231
|
val arr = Arguments.createArray().apply { list.forEach { pushString(it) } }
|
|
229
232
|
val m = Arguments.createMap().apply { putArray("value", arr) }
|
|
230
233
|
send("onSpeechPartialResults", m)
|
|
@@ -99,7 +99,9 @@ RCT_EXPORT_METHOD(initTTS:(NSDictionary *)configDict
|
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
NSURL *modelURL = [
|
|
102
|
+
NSURL *modelURL = [modelPath hasPrefix:@"file://"]
|
|
103
|
+
? [NSURL URLWithString:modelPath]
|
|
104
|
+
: [NSURL fileURLWithPath:modelPath];
|
|
103
105
|
|
|
104
106
|
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
|
105
107
|
NSError *error = nil;
|
|
@@ -110,6 +112,9 @@ RCT_EXPORT_METHOD(initTTS:(NSDictionary *)configDict
|
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
115
|
+
if (self.ttsInstance) {
|
|
116
|
+
@try { [self.ttsInstance stopSpeaking]; [self.ttsInstance destroy]; } @catch (__unused id e) {}
|
|
117
|
+
}
|
|
113
118
|
self.ttsInstance = tts;
|
|
114
119
|
|
|
115
120
|
__weak typeof(self) weakSelf = self;
|
|
@@ -142,6 +147,24 @@ RCT_EXPORT_METHOD(initTTS:(NSDictionary *)configDict
|
|
|
142
147
|
});
|
|
143
148
|
}
|
|
144
149
|
|
|
150
|
+
RCT_EXPORT_METHOD(speakWithSpeed:(NSString *)text
|
|
151
|
+
speakerId:(nonnull NSNumber *)speakerId
|
|
152
|
+
speed:(nonnull NSNumber *)speed
|
|
153
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
154
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
155
|
+
{
|
|
156
|
+
if (!self.ttsInstance) {
|
|
157
|
+
reject(@"no_instance", @"TTS not initialized", nil);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
162
|
+
float s = speed ? speed.floatValue : 1.0f;
|
|
163
|
+
[self.ttsInstance speak:text sid:speakerId.intValue speed:s];
|
|
164
|
+
resolve(@"Speaking");
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
145
168
|
RCT_EXPORT_METHOD(stopSpeaking:(RCTPromiseResolveBlock)resolve
|
|
146
169
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
147
170
|
{
|