react-native-davoice-tts 1.0.373 → 1.0.374

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 (27) hide show
  1. package/README.md +18 -0
  2. package/TTSRNBridge.podspec +1 -1
  3. package/ios/SpeechBridge/SpeechBridge.m +8 -0
  4. package/ios/TTSRNBridge/DaVoiceTTSBridge.m +9 -1
  5. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/DavoiceTTS +0 -0
  6. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Headers/DavoiceTTS-Swift.h +1 -0
  7. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +519 -226
  8. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +5 -0
  9. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  10. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftinterface +5 -0
  11. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/TtsV2Notices.txt +208 -0
  12. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/DavoiceTTS +0 -0
  13. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Headers/DavoiceTTS-Swift.h +2 -0
  14. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +519 -226
  15. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +5 -0
  16. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  17. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface +5 -0
  18. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +519 -226
  19. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +5 -0
  20. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  21. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +5 -0
  22. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/TtsV2Notices.txt +208 -0
  23. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeDirectory +0 -0
  24. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeRequirements-1 +0 -0
  25. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeResources +48 -33
  26. package/package.json +1 -1
  27. package/speech/index.ts +5 -3
package/README.md CHANGED
@@ -342,3 +342,21 @@ For licensing, production integration, or custom deployments:
342
342
  ## License
343
343
 
344
344
  MIT for the React Native wrapper. Native model/runtime licensing may require a commercial DaVoice license depending on your deployment.
345
+
346
+ ### Reference voice selection (iOS and Android)
347
+
348
+ For a ttsv2 model container containing `newTTS/<language>/voice_rec/*.wav`,
349
+ the initial voice is the first WAV sorted alphabetically, ignoring case.
350
+ The backend uses WAV references and does not load `voices.bin`.
351
+
352
+ ```ts
353
+ const result = await speech.changeVoice("Rich");
354
+ // 0: selected a matching WAV (Rich.wav, rICH.WAV, etc.).
355
+ // -1: no match; selected the first WAV as fallback.
356
+ ```
357
+
358
+ Call after TTS initialization. Missing names are silent and do not throw.
359
+ Changes apply to subsequent synthesis; already queued audio retains its voice.
360
+ Legacy model backends and unavailable/uninitialized bridges return -1.
361
+ The existing speak speed argument still applies, with pitch preserved.
362
+ Rebuild the native app after updating the bundled AAR/XCFramework.
@@ -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.310" # Update to your package version
5
+ s.version = "1.0.312" # 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 .
@@ -948,6 +948,14 @@ RCT_EXPORT_METHOD(setAECEnabled:(BOOL)enabled
948
948
  resolve(@(YES));
949
949
  }
950
950
 
951
+ RCT_EXPORT_METHOD(changeVoice:(NSString *)name
952
+ resolver:(RCTPromiseResolveBlock)resolve
953
+ rejecter:(RCTPromiseRejectBlock)reject)
954
+ {
955
+ if (!self.tts || !name) { resolve(@(-1)); return; }
956
+ [self.tts changeVoice:name completion:^(NSInteger result) { resolve(@(result)); }];
957
+ }
958
+
951
959
  RCT_EXPORT_METHOD(speak:(NSString *)text
952
960
  speakerId:(nonnull NSNumber *)speakerId
953
961
  speed:(nonnull NSNumber *)speed
@@ -225,7 +225,15 @@ RCT_EXPORT_METHOD(initTTS:(NSDictionary *)configDict
225
225
  });
226
226
  }
227
227
 
228
- RCT_EXPORT_METHOD(speak:(NSString *)text
228
+ RCT_EXPORT_METHOD(changeVoice:(NSString *)name
229
+ resolver:(RCTPromiseResolveBlock)resolve
230
+ rejecter:(RCTPromiseRejectBlock)reject)
231
+ {
232
+ if (!self.ttsInstance || !name) { resolve(@(-1)); return; }
233
+ [self.ttsInstance changeVoice:name completion:^(NSInteger result) { resolve(@(result)); }];
234
+ }
235
+
236
+ RCT_EXPORT_METHOD(speak:(NSString *)text
229
237
  speakerId:(nonnull NSNumber *)speakerId
230
238
  resolver:(RCTPromiseResolveBlock)resolve
231
239
  rejecter:(RCTPromiseRejectBlock)reject)
@@ -325,6 +325,7 @@ SWIFT_CLASS("_TtC10DavoiceTTS10DaVoiceTTS")
325
325
  + (void)setUseDavoiceProprietaryPhonemizer:(BOOL)enabled;
326
326
  + (BOOL)getUseDavoiceProprietaryPhonemizer SWIFT_WARN_UNUSED_RESULT;
327
327
  - (BOOL)isUsingDavoiceProprietaryPhonemizer SWIFT_WARN_UNUSED_RESULT;
328
+ - (void)changeVoice:(NSString * _Nonnull)name completion:(void (^ _Nonnull)(NSInteger))completion;
328
329
  @property (nonatomic, copy) void (^ _Nullable onLastUtteranceFinished)(void);
329
330
  + (BOOL)activateLicenseWithLicenseKey:(NSString * _Nonnull)licenseKey SWIFT_WARN_UNUSED_RESULT;
330
331
  - (BOOL)setLicenseWithLicenseKey:(NSString * _Nonnull)licenseKey SWIFT_WARN_UNUSED_RESULT;