react-native-davoice-tts 1.0.321 → 1.0.323

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.
Files changed (18) hide show
  1. package/TTSRNBridge.podspec +1 -1
  2. package/ios/SpeechBridge/SpeechBridge.m +38 -0
  3. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/DavoiceTTS +0 -0
  4. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +8854 -8833
  5. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +77 -77
  6. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftinterface +77 -77
  7. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/DavoiceTTS +0 -0
  8. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +8757 -8736
  9. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +53 -53
  10. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface +53 -53
  11. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +8757 -8736
  12. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +53 -53
  13. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +53 -53
  14. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeDirectory +0 -0
  15. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeRequirements-1 +0 -0
  16. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeResources +24 -24
  17. package/package.json +1 -1
  18. package/speech/index.ts +26 -2
@@ -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.203" # Update to your package version
5
+ s.version = "1.0.205" # 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 .
@@ -25,6 +25,21 @@ static BOOL SBHasSpeechRecognitionPermission(void) {
25
25
  return status == SFSpeechRecognizerAuthorizationStatusAuthorized;
26
26
  }
27
27
 
28
+ static NSString *SBNowString(void) {
29
+ static NSDateFormatter *formatter = nil;
30
+ static dispatch_once_t onceToken;
31
+ dispatch_once(&onceToken, ^{
32
+ formatter = [NSDateFormatter new];
33
+ formatter.locale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"];
34
+ formatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ";
35
+ });
36
+ return [formatter stringFromDate:[NSDate date]];
37
+ }
38
+
39
+ static NSString *SBBoolString(BOOL value) {
40
+ return value ? @"YES" : @"NO";
41
+ }
42
+
28
43
  // Make a mono Float32 AVAudioPCMBuffer from raw PCM payload (i16 or f32).
29
44
  // We accept either interleaved or non-interleaved input and mixdown to mono
30
45
  // (DaVoiceTTS.playBuffer will resample / normalize as needed).
@@ -535,14 +550,22 @@ RCT_EXPORT_METHOD(pauseSpeechRecognitionLiteAsync:(nonnull NSNumber *)timeoutMs
535
550
 
536
551
  NSNumber *t = timeoutMs ?: @(1500);
537
552
  if (t.doubleValue <= 0) t = @(1500);
553
+ CFTimeInterval startedAt = CACurrentMediaTime();
554
+ RCTLogInfo(@"[SpeechBridge] %@ pauseSpeechRecognitionLiteAsync begin timeoutMs=%@ stt=%@", SBNowString(), t, self.stt);
538
555
 
539
556
  if ([(id)self.stt respondsToSelector:@selector(pauseSpeechRecognitionLiteAndWait:completion:)]) {
540
557
  [(id)self.stt pauseSpeechRecognitionLiteAndWait:t completion:^(BOOL ok, NSString * _Nullable reason) {
558
+ RCTLogInfo(@"[SpeechBridge] %@ pauseSpeechRecognitionLiteAsync resolved elapsedMs=%.1f ok=%@ reason=%@",
559
+ SBNowString(),
560
+ (CACurrentMediaTime() - startedAt) * 1000.0,
561
+ SBBoolString(ok),
562
+ reason ?: @"");
541
563
  resolve(@{@"ok": @(ok), @"reason": reason ?: @""});
542
564
  }];
543
565
  return;
544
566
  }
545
567
 
568
+ RCTLogInfo(@"[SpeechBridge] %@ pauseSpeechRecognitionLiteAsync fallback no-wait", SBNowString());
546
569
  [self.stt pauseSpeechRecognitionLite];
547
570
  resolve(@{@"ok": @(YES), @"reason": @"bridge_fallback_no_wait_method"});
548
571
  }
@@ -578,17 +601,32 @@ RCT_EXPORT_METHOD(unPauseSpeechRecognitionLiteAsync:(nonnull NSNumber *)times
578
601
  if (t.doubleValue <= 0) t = @(2500);
579
602
  NSNumber *pf = preFetch ?: @(0);
580
603
  if (pf.doubleValue < 0) pf = @(0);
604
+ CFTimeInterval startedAt = CACurrentMediaTime();
605
+ RCTLogInfo(@"[SpeechBridge] %@ unPauseSpeechRecognitionLiteAsync begin times=%@ preFetchMs=%@ timeoutMs=%@ stt=%@ initialized=%@ initializing=%@",
606
+ SBNowString(),
607
+ times,
608
+ pf,
609
+ t,
610
+ self.stt,
611
+ SBBoolString(self.initialized),
612
+ SBBoolString(self.initializing));
581
613
 
582
614
  if ([(id)self.stt respondsToSelector:@selector(unPauseSpeechRecognitionLiteAndWait:preFetch:timeoutMs:completion:)]) {
583
615
  [(id)self.stt unPauseSpeechRecognitionLiteAndWait:times
584
616
  preFetch:pf
585
617
  timeoutMs:t
586
618
  completion:^(BOOL ok, NSString * _Nullable reason) {
619
+ RCTLogInfo(@"[SpeechBridge] %@ unPauseSpeechRecognitionLiteAsync resolved elapsedMs=%.1f ok=%@ reason=%@",
620
+ SBNowString(),
621
+ (CACurrentMediaTime() - startedAt) * 1000.0,
622
+ SBBoolString(ok),
623
+ reason ?: @"");
587
624
  resolve(@{@"ok": @(ok), @"reason": reason ?: @""});
588
625
  }];
589
626
  return;
590
627
  }
591
628
 
629
+ RCTLogInfo(@"[SpeechBridge] %@ unPauseSpeechRecognitionLiteAsync fallback no-wait", SBNowString());
592
630
  [self.stt unPauseSpeechRecognitionLite:times preFetch:pf];
593
631
  resolve(@{@"ok": @(YES), @"reason": @"bridge_fallback_no_wait_method"});
594
632
  }