react-native-davoice-tts 1.0.406 → 1.0.408

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 +11 -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 +16 -0
  7. package/ios/SpeechBridge/SpeechBridge.m +6 -0
  8. package/ios/TTSRNBridge/DaVoiceTTSBridge.m +6 -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 +4 -0
  11. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +433 -122
  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 +8 -0
  17. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +433 -122
  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 +433 -122
  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 +5 -0
  30. package/speech/index.ts +16 -0
package/README.md CHANGED
@@ -358,5 +358,16 @@ const result = await speech.changeVoice("Rich");
358
358
  Call after TTS initialization. Missing names are silent and do not throw.
359
359
  Changes apply to subsequent synthesis; already queued audio retains its voice.
360
360
  Legacy model backends and unavailable/uninitialized bridges return -1.
361
+
362
+ List the voices packed in the loaded `.dm` (the names `changeVoice()` accepts;
363
+ the first is the default):
364
+
365
+ ```ts
366
+ const voices = await speech.getAllVoices();
367
+ // e.g. ["Ariana", "Gloria", "Hanna", "Jenny", "Kate", "Matthew", "Rich"]
368
+ ```
369
+
370
+ Resolves `[]` when no ex2 `.dm` is loaded, the `.dm` has no voices, or the
371
+ bridge is unavailable.
361
372
  The existing speak speed argument still applies, with pitch preserved.
362
373
  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.399" # Update to your package version
5
+ s.version = "1.0.403" # 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
- e92b94f52a72a258f8b1e37289e0a779 tts-1.0.0.aar
1
+ 59810405c498a9500a114250e9851c60 tts-1.0.0.aar
@@ -1 +1 @@
1
- 83fce3d52b29ef2d53b9fc34694262264af77495 tts-1.0.0.aar
1
+ f5abacc505e4eaf5b427581374c1a9cc7fed9c35 tts-1.0.0.aar
@@ -2,11 +2,13 @@
2
2
  package com.davoice.tts.rn;
3
3
 
4
4
  import androidx.annotation.Nullable;
5
+ import com.facebook.react.bridge.Arguments;
5
6
  import com.facebook.react.bridge.Promise;
6
7
  import com.facebook.react.bridge.ReactApplicationContext;
7
8
  import com.facebook.react.bridge.ReactContextBaseJavaModule;
8
9
  import com.facebook.react.bridge.ReactMethod;
9
10
  import com.facebook.react.bridge.ReadableMap;
11
+ import com.facebook.react.bridge.WritableArray;
10
12
  import com.facebook.react.bridge.WritableMap;
11
13
  import com.facebook.react.modules.core.DeviceEventManagerModule;
12
14
  // ADD
@@ -357,6 +359,20 @@ public class DaVoiceTTSBridge extends ReactContextBaseJavaModule {
357
359
  return null;
358
360
  }
359
361
 
362
+ // Voices available in the loaded .dm; [] when none (or no ttsv2 .dm).
363
+ @ReactMethod
364
+ public void getAllVoices(Promise promise) {
365
+ WritableArray voices = Arguments.createArray();
366
+ try {
367
+ if (tts != null) {
368
+ for (String name : tts.getAllVoices()) voices.pushString(name);
369
+ }
370
+ } catch (Exception ignored) {
371
+ voices = Arguments.createArray();
372
+ }
373
+ promise.resolve(voices);
374
+ }
375
+
360
376
  @ReactMethod
361
377
  public void changeVoice(String name, Promise promise) {
362
378
  try {
@@ -1203,6 +1203,12 @@ RCT_EXPORT_METHOD(setAECEnabled:(BOOL)enabled
1203
1203
  resolve(@(YES));
1204
1204
  }
1205
1205
 
1206
+ RCT_EXPORT_METHOD(getAllVoices:(RCTPromiseResolveBlock)resolve
1207
+ rejecter:(RCTPromiseRejectBlock)reject)
1208
+ {
1209
+ resolve(self.tts ? ([self.tts getAllVoices] ?: @[]) : @[]);
1210
+ }
1211
+
1206
1212
  RCT_EXPORT_METHOD(changeVoice:(NSString *)name
1207
1213
  resolver:(RCTPromiseResolveBlock)resolve
1208
1214
  rejecter:(RCTPromiseRejectBlock)reject)
@@ -276,6 +276,12 @@ RCT_EXPORT_METHOD(initTTS:(NSDictionary *)configDict
276
276
  }];
277
277
  }
278
278
 
279
+ RCT_EXPORT_METHOD(getAllVoices:(RCTPromiseResolveBlock)resolve
280
+ rejecter:(RCTPromiseRejectBlock)reject)
281
+ {
282
+ resolve(self.ttsInstance ? ([self.ttsInstance getAllVoices] ?: @[]) : @[]);
283
+ }
284
+
279
285
  RCT_EXPORT_METHOD(changeVoice:(NSString *)name
280
286
  resolver:(RCTPromiseResolveBlock)resolve
281
287
  rejecter:(RCTPromiseRejectBlock)reject)
@@ -350,6 +350,10 @@ SWIFT_CLASS("_TtC10DavoiceTTS10DaVoiceTTS")
350
350
  + (void)setUseDavoiceProprietaryPhonemizer:(BOOL)enabled;
351
351
  + (BOOL)getUseDavoiceProprietaryPhonemizer SWIFT_WARN_UNUSED_RESULT;
352
352
  - (BOOL)isUsingDavoiceProprietaryPhonemizer SWIFT_WARN_UNUSED_RESULT;
353
+ /// Voices available in the loaded .dm (the names changeVoice() accepts, the
354
+ /// first being the default). Empty for v1 models, a .dm without voices, or
355
+ /// after destroy().
356
+ - (NSArray<NSString *> * _Nonnull)getAllVoices SWIFT_WARN_UNUSED_RESULT;
353
357
  - (void)changeVoice:(NSString * _Nonnull)name completion:(void (^ _Nonnull)(NSInteger))completion;
354
358
  @property (nonatomic, copy) void (^ _Nullable onLastUtteranceFinished)(void);
355
359
  + (BOOL)activateLicenseWithLicenseKey:(NSString * _Nonnull)licenseKey SWIFT_WARN_UNUSED_RESULT;