react-native-davoice-tts 1.0.280 → 1.0.282
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/src/main/java/com/davoice/tts/rn/DaVoiceTTSBridge.java +26 -0
- package/ios/SpeechBridge/SpeechBridge.m +19 -1
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/DavoiceTTS +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Headers/DavoiceTTS-Swift.h +23 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +10665 -3965
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +149 -36
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftinterface +149 -36
- 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/Headers/DavoiceTTS-Swift.h +46 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +8593 -1893
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +113 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface +113 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +8593 -1893
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +113 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +113 -0
- 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 +33 -33
- package/package.json +1 -1
- package/speech/index.ts +52 -4
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.155" # 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 .
|
|
@@ -204,6 +204,32 @@ public class DaVoiceTTSBridge extends ReactContextBaseJavaModule {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
@ReactMethod
|
|
208
|
+
public void initTTSPlaybackOnly(Promise promise) {
|
|
209
|
+
try {
|
|
210
|
+
// Always wire completion events for JS queueing.
|
|
211
|
+
tts.setOnFinishedSpeakingListenerJava(() -> sendEvent("onFinishedSpeaking", null));
|
|
212
|
+
|
|
213
|
+
boolean ok = true;
|
|
214
|
+
// Keep backwards compatibility with older TTS AARs that don't have initPlaybackOnly().
|
|
215
|
+
try {
|
|
216
|
+
java.lang.reflect.Method m = tts.getClass().getMethod("initPlaybackOnly");
|
|
217
|
+
Object out = m.invoke(tts);
|
|
218
|
+
if (out instanceof Boolean) ok = (Boolean) out;
|
|
219
|
+
} catch (NoSuchMethodException noSuchMethod) {
|
|
220
|
+
Log.w(TAG, "initTTSPlaybackOnly: initPlaybackOnly() not found on TTS interface; using lazy playback fallback");
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (!ok) {
|
|
224
|
+
promise.reject("InitFailed", "Playback-only TTS init failed");
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
promise.resolve(true);
|
|
228
|
+
} catch (Exception e) {
|
|
229
|
+
promise.reject("InitError", e.getMessage(), e);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
207
233
|
private @Nullable File tryGetModelsPackAssetsPath(Context ctx) {
|
|
208
234
|
try {
|
|
209
235
|
Class<?> factoryClz = Class.forName("com.google.android.play.core.assetpacks.AssetPackManagerFactory");
|
|
@@ -250,6 +250,7 @@ RCT_EXPORT_METHOD(initAll:(NSDictionary *)opts
|
|
|
250
250
|
self.initializing = YES;
|
|
251
251
|
|
|
252
252
|
NSString *locale = opts[@"locale"] ?: @"en-US";
|
|
253
|
+
NSString *onboardingJsonPath = opts[@"onboardingJsonPath"];
|
|
253
254
|
NSString *modelPath = opts[@"model"];
|
|
254
255
|
if (modelPath.length == 0) {
|
|
255
256
|
self.initializing = NO;
|
|
@@ -262,7 +263,11 @@ RCT_EXPORT_METHOD(initAll:(NSDictionary *)opts
|
|
|
262
263
|
self.stt = [STT new];
|
|
263
264
|
self.stt.delegate = self;
|
|
264
265
|
}
|
|
265
|
-
[
|
|
266
|
+
if (onboardingJsonPath && (id)onboardingJsonPath != [NSNull null] && onboardingJsonPath.length > 0) {
|
|
267
|
+
[self.stt startSpeechWithLocaleStr:locale onboardingJsonPath:onboardingJsonPath];
|
|
268
|
+
} else {
|
|
269
|
+
[self.stt startSpeechWithLocaleStr:locale];
|
|
270
|
+
}
|
|
266
271
|
|
|
267
272
|
// 2) TTS next
|
|
268
273
|
NSURL *modelURL = nil;
|
|
@@ -420,6 +425,19 @@ RCT_EXPORT_METHOD(startSpeech:(NSString *)locale
|
|
|
420
425
|
if (callback) callback(@[@(NO)]);
|
|
421
426
|
}
|
|
422
427
|
|
|
428
|
+
RCT_EXPORT_METHOD(startSpeechWithSVOnboardingJson:(NSString *)locale
|
|
429
|
+
onboardingJsonPath:(NSString *)onboardingJsonPath
|
|
430
|
+
callback:(RCTResponseSenderBlock)callback)
|
|
431
|
+
{
|
|
432
|
+
[self ensureSTT];
|
|
433
|
+
if (onboardingJsonPath && (id)onboardingJsonPath != [NSNull null] && onboardingJsonPath.length > 0) {
|
|
434
|
+
[self.stt startSpeechWithLocaleStr:locale onboardingJsonPath:onboardingJsonPath];
|
|
435
|
+
} else {
|
|
436
|
+
[self.stt startSpeechWithLocaleStr:locale];
|
|
437
|
+
}
|
|
438
|
+
if (callback) callback(@[@(NO)]);
|
|
439
|
+
}
|
|
440
|
+
|
|
423
441
|
RCT_EXPORT_METHOD(stopSpeech:(RCTResponseSenderBlock)callback)
|
|
424
442
|
{
|
|
425
443
|
if (!self.stt) { if (callback) callback(@[@(NO)]); return; }
|
|
Binary file
|
|
@@ -342,6 +342,13 @@ SWIFT_CLASS("_TtC10DavoiceTTS3STT")
|
|
|
342
342
|
@property (nonatomic, weak) id <STTDelegate> _Nullable delegate;
|
|
343
343
|
@property (nonatomic) BOOL continuous;
|
|
344
344
|
@property (nonatomic) BOOL aecEnabled;
|
|
345
|
+
@property (nonatomic) BOOL force16kMicSampleRate;
|
|
346
|
+
@property (nonatomic) BOOL useLegacySpeakerGateBehavior;
|
|
347
|
+
@property (nonatomic) BOOL useSpeakerGateHangover;
|
|
348
|
+
@property (nonatomic) double speakerGateHangoverSeconds;
|
|
349
|
+
@property (nonatomic) BOOL useShortSpeakerVerificationTailWindow;
|
|
350
|
+
@property (nonatomic) float shortSpeakerVerificationTailSeconds;
|
|
351
|
+
@property (nonatomic) double speakerPreRollFlushMaxSeconds;
|
|
345
352
|
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSArray<NSString *> * _Nonnull supportedEvents;)
|
|
346
353
|
+ (NSArray<NSString *> * _Nonnull)supportedEvents SWIFT_WARN_UNUSED_RESULT;
|
|
347
354
|
- (void)pauseSpeechRecognitionLite;
|
|
@@ -357,6 +364,7 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSArray<NSStri
|
|
|
357
364
|
- (void)isSpeechAvailable:(void (^ _Nonnull)(BOOL))completion;
|
|
358
365
|
- (BOOL)isRecognizing SWIFT_WARN_UNUSED_RESULT;
|
|
359
366
|
- (void)startSpeechWithLocaleStr:(NSString * _Nullable)localeStr;
|
|
367
|
+
- (void)startSpeechWithLocaleStr:(NSString * _Nullable)localeStr onboardingJsonPath:(NSString * _Nonnull)onboardingJsonPath;
|
|
360
368
|
- (void)stopSpeech:(void (^ _Nullable)(BOOL))completion;
|
|
361
369
|
- (void)cancelSpeech:(void (^ _Nullable)(BOOL))completion;
|
|
362
370
|
- (void)destroySpeech:(void (^ _Nullable)(BOOL))completion;
|
|
@@ -370,6 +378,21 @@ SWIFT_PROTOCOL("_TtP10DavoiceTTS11STTDelegate_")
|
|
|
370
378
|
- (void)stt:(STT * _Nonnull)stt didEmitEvent:(NSString * _Nonnull)name body:(NSDictionary<NSString *, id> * _Nullable)body;
|
|
371
379
|
@end
|
|
372
380
|
|
|
381
|
+
SWIFT_CLASS("_TtC10DavoiceTTS25SpeakerVerificationEngine")
|
|
382
|
+
@interface SpeakerVerificationEngine : NSObject
|
|
383
|
+
- (void)resetStreamingState;
|
|
384
|
+
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
385
|
+
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
386
|
+
@end
|
|
387
|
+
|
|
388
|
+
@class NSError;
|
|
389
|
+
SWIFT_CLASS_NAMED("SpeakerVerificationRNFacade")
|
|
390
|
+
@interface DavoiceSpeakerVerificationRNFacade : NSObject
|
|
391
|
+
+ (id _Nullable)createEngineWithModelPath:(NSString * _Nonnull)modelPath enrollmentJsonPath:(NSString * _Nonnull)enrollmentJsonPath options:(NSDictionary<NSString *, id> * _Nonnull)options error:(NSError * _Nullable * _Nullable)outError SWIFT_WARN_UNUSED_RESULT;
|
|
392
|
+
+ (NSDictionary<NSString *, id> * _Nullable)verifyWavWithEngine:(id _Nonnull)engine wavPath:(NSString * _Nonnull)wavPath reset:(BOOL)reset error:(NSError * _Nullable * _Nullable)outError SWIFT_WARN_UNUSED_RESULT;
|
|
393
|
+
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
394
|
+
@end
|
|
395
|
+
|
|
373
396
|
@class AVAudioPlayer;
|
|
374
397
|
SWIFT_CLASS("_TtC10DavoiceTTS15SwiftSoundQueue")
|
|
375
398
|
@interface SwiftSoundQueue : NSObject <AVAudioPlayerDelegate>
|