react-native-davoice-tts 1.0.407 → 1.0.409

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 (30) hide show
  1. package/README.md +14 -0
  2. package/TTSRNBridge.podspec +1 -1
  3. package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar +0 -0
  4. package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar.md5 +1 -1
  5. package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar.sha1 +1 -1
  6. package/android/src/main/java/com/davoice/tts/rn/DaVoiceTTSBridge.java +14 -0
  7. package/ios/SpeechBridge/SpeechBridge.m +7 -0
  8. package/ios/TTSRNBridge/DaVoiceTTSBridge.m +7 -0
  9. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/DavoiceTTS +0 -0
  10. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Headers/DavoiceTTS-Swift.h +7 -0
  11. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +249 -50
  12. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +1 -0
  13. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  14. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftinterface +1 -0
  15. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/DavoiceTTS +0 -0
  16. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Headers/DavoiceTTS-Swift.h +14 -0
  17. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +249 -50
  18. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1 -0
  19. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  20. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
  21. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +249 -50
  22. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1 -0
  23. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  24. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1 -0
  25. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeDirectory +0 -0
  26. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeRequirements-1 +0 -0
  27. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeResources +33 -33
  28. package/package.json +1 -1
  29. package/speech/index.d.ts +9 -0
  30. package/speech/index.ts +20 -0
package/README.md CHANGED
@@ -369,5 +369,19 @@ const voices = await speech.getAllVoices();
369
369
 
370
370
  Resolves `[]` when no ex2 `.dm` is loaded, the `.dm` has no voices, or the
371
371
  bridge is unavailable.
372
+
373
+ #### Voice styles ("abilities")
374
+
375
+ Some voices ship style variants. List them, then use ElevenLabs-style tags in
376
+ the text: free text in square brackets before the words it applies to. A tag
377
+ applies until the next tag; `[regular]` returns to the normal voice. Tags are
378
+ never spoken, and a tag that matches nothing uses the normal voice.
379
+
380
+ ```ts
381
+ await speech.getVoiceAbilities("Rich");
382
+ // ["angry_whisper", "disappointed", ..., "military_sergeant_hard", ..., "whisper"]
383
+ await speech.changeVoice("Rich");
384
+ await speech.speak("Ok, [drill sergeant] Private, give me 50 push-ups! [regular] And you, Daniel, come with me.");
385
+ ```
372
386
  The existing speak speed argument still applies, with pitch preserved.
373
387
  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.401" # Update to your package version
5
+ s.version = "1.0.405" # 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 .
@@ -1 +1 @@
1
- 8f7632a348c787a68e9282f3ce8e48dc tts-1.0.0.aar
1
+ 135c22d998ff29b3e1aeabc5a1fd1392 tts-1.0.0.aar
@@ -1 +1 @@
1
- 86d0f842139d70bec863c85b3d86f56d0279124d tts-1.0.0.aar
1
+ 15e71c2af9e1a87f8a181497d0caafc0ef18e717 tts-1.0.0.aar
@@ -373,6 +373,20 @@ public class DaVoiceTTSBridge extends ReactContextBaseJavaModule {
373
373
  promise.resolve(voices);
374
374
  }
375
375
 
376
+ // Style variants ("abilities") of a voice in the loaded .dm; [] when none.
377
+ @ReactMethod
378
+ public void getVoiceAbilities(String name, Promise promise) {
379
+ WritableArray abilities = Arguments.createArray();
380
+ try {
381
+ if (tts != null && name != null) {
382
+ for (String ability : tts.getVoiceAbilities(name)) abilities.pushString(ability);
383
+ }
384
+ } catch (Exception ignored) {
385
+ abilities = Arguments.createArray();
386
+ }
387
+ promise.resolve(abilities);
388
+ }
389
+
376
390
  @ReactMethod
377
391
  public void changeVoice(String name, Promise promise) {
378
392
  try {
@@ -1209,6 +1209,13 @@ RCT_EXPORT_METHOD(getAllVoices:(RCTPromiseResolveBlock)resolve
1209
1209
  resolve(self.tts ? ([self.tts getAllVoices] ?: @[]) : @[]);
1210
1210
  }
1211
1211
 
1212
+ RCT_EXPORT_METHOD(getVoiceAbilities:(NSString *)name
1213
+ resolver:(RCTPromiseResolveBlock)resolve
1214
+ rejecter:(RCTPromiseRejectBlock)reject)
1215
+ {
1216
+ resolve(self.tts && name ? ([self.tts getVoiceAbilities:name] ?: @[]) : @[]);
1217
+ }
1218
+
1212
1219
  RCT_EXPORT_METHOD(changeVoice:(NSString *)name
1213
1220
  resolver:(RCTPromiseResolveBlock)resolve
1214
1221
  rejecter:(RCTPromiseRejectBlock)reject)
@@ -282,6 +282,13 @@ RCT_EXPORT_METHOD(getAllVoices:(RCTPromiseResolveBlock)resolve
282
282
  resolve(self.ttsInstance ? ([self.ttsInstance getAllVoices] ?: @[]) : @[]);
283
283
  }
284
284
 
285
+ RCT_EXPORT_METHOD(getVoiceAbilities:(NSString *)name
286
+ resolver:(RCTPromiseResolveBlock)resolve
287
+ rejecter:(RCTPromiseRejectBlock)reject)
288
+ {
289
+ resolve(self.ttsInstance && name ? ([self.ttsInstance getVoiceAbilities:name] ?: @[]) : @[]);
290
+ }
291
+
285
292
  RCT_EXPORT_METHOD(changeVoice:(NSString *)name
286
293
  resolver:(RCTPromiseResolveBlock)resolve
287
294
  rejecter:(RCTPromiseRejectBlock)reject)
@@ -354,6 +354,13 @@ SWIFT_CLASS("_TtC10DavoiceTTS10DaVoiceTTS")
354
354
  /// first being the default). Empty for v1 models, a .dm without voices, or
355
355
  /// after destroy().
356
356
  - (NSArray<NSString *> * _Nonnull)getAllVoices SWIFT_WARN_UNUSED_RESULT;
357
+ /// Style variants (“abilities”) of a voice in the loaded .dm, e.g.
358
+ /// getVoiceAbilities(“Rich”) -> [“angry_whisper”, …, “military_sergeant_hard”, …].
359
+ /// Use them with ElevenLabs-style “[free text]” tags in speak() text, before
360
+ /// the words they apply to, until the next tag: “Ok, [drill sergeant] give me
361
+ /// 50! [regular] Thanks.” Unmatched tags use the default voice; tags are never
362
+ /// spoken. Empty for voices without variants, v1 models, or after destroy().
363
+ - (NSArray<NSString *> * _Nonnull)getVoiceAbilities:(NSString * _Nonnull)name SWIFT_WARN_UNUSED_RESULT;
357
364
  - (void)changeVoice:(NSString * _Nonnull)name completion:(void (^ _Nonnull)(NSInteger))completion;
358
365
  @property (nonatomic, copy) void (^ _Nullable onLastUtteranceFinished)(void);
359
366
  + (BOOL)activateLicenseWithLicenseKey:(NSString * _Nonnull)licenseKey SWIFT_WARN_UNUSED_RESULT;