react-native-wakeword-sid 1.1.105 → 1.1.197
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/KeyWordRNBridge.podspec +1 -1
- package/README.md +2 -3
- package/android/build.gradle +1 -1
- package/android/libs/com/davoice/keyworddetection/1.0.0/keyworddetection-1.0.0.aar +0 -0
- package/android/libs/com/davoice/keyworddetection/1.0.0/keyworddetection-1.0.0.aar.md5 +1 -1
- package/android/libs/com/davoice/keyworddetection/1.0.0/keyworddetection-1.0.0.aar.sha1 +1 -1
- package/android/src/main/AndroidManifest.xml +0 -4
- package/android/src/main/java/com/davoice/DaVoiceUnifiedPackage.java +3 -3
- package/android/src/main/java/com/davoice/keywordspotting/KeyWordRNBridge.java +7 -5
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64/KeyWordDetection.framework/Headers/KeyWordDetection-Swift.h +50 -18
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64/KeyWordDetection.framework/Info.plist +0 -0
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64/KeyWordDetection.framework/KeyWordDetection +0 -0
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/arm64-apple-ios.abi.json +9150 -2642
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/arm64-apple-ios.private.swiftinterface +149 -16
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/arm64-apple-ios.swiftinterface +149 -16
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Headers/KeyWordDetection-Swift.h +100 -36
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Info.plist +0 -0
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/KeyWordDetection +0 -0
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/arm64-apple-ios-simulator.abi.json +9150 -2642
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +149 -16
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/arm64-apple-ios-simulator.swiftinterface +149 -16
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/x86_64-apple-ios-simulator.abi.json +9150 -2642
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +149 -16
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +149 -16
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/_CodeSignature/CodeResources +34 -34
- package/ios/KeyWordRNBridge/KeyWordRNBridge.m +1079 -0
- package/ios/KeyWordRNBridge/KeyWordRNBridge.mm +24 -3
- package/package.json +1 -2
- package/wakewords/KeyWordRNBridge.d.ts +1 -0
- package/wakewords/KeyWordRNBridge.js +7 -0
- package/wakewords/SpeakerVerificationRNBridge.d.ts +49 -0
- package/wakewords/SpeakerVerificationRNBridge.js +316 -0
- package/wakewords/audioRoutingConfig.d.ts +17 -0
- package/wakewords/audioRoutingConfig.ts +28 -0
- package/wakewords/index.d.ts +10 -1
- package/wakewords/index.js +29 -0
- package/speakerid/SpeakerIdRNBridge.d.ts +0 -49
- package/speakerid/SpeakerIdRNBridge.js +0 -193
- package/speakerid/index.d.ts +0 -22
- package/speakerid/index.js +0 -28
- package/speakerid/models/speaker_id.dm +0 -0
- /package/android/src/main/java/com/davoice/speakeridrn/{SpeakerIdRNBridge.java → SpeakerIdRNBridge.java_not_used_yet} +0 -0
package/KeyWordRNBridge.podspec
CHANGED
|
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
|
|
17
17
|
# s.source_files = "ios/*.{h,m,mm,swift}"
|
|
18
18
|
s.resources = "ios/KeyWordRNBridge/models/*"
|
|
19
|
-
s.source_files = 'ios/KeyWordRNBridge/KeyWordRNBridge.h', 'ios/KeyWordRNBridge/KeyWordRNBridge.
|
|
19
|
+
s.source_files = 'ios/KeyWordRNBridge/KeyWordRNBridge.h', 'ios/KeyWordRNBridge/KeyWordRNBridge.m'
|
|
20
20
|
|
|
21
21
|
#s.static_framework = true
|
|
22
22
|
|
package/README.md
CHANGED
|
@@ -9,6 +9,8 @@ By [DaVoice.io](https://davoice.io)
|
|
|
9
9
|
Welcome to **Davoice React-Native Wake Word / hotword / Keywords Detection** – Wake words and keyword detection solution designed by **DaVoice.io**.
|
|
10
10
|
|
|
11
11
|
## New:
|
|
12
|
+
Android - 16KB alignment.
|
|
13
|
+
|
|
12
14
|
Fix IOS crash when retaking microphone after a call.
|
|
13
15
|
|
|
14
16
|
Fix IOS issue with static Podfile linkage.
|
|
@@ -44,9 +46,6 @@ Top Player 0.874812
|
|
|
44
46
|
Third 0.626567
|
|
45
47
|
```
|
|
46
48
|
|
|
47
|
-
Please check this link for an official benchmake by lookdeep.health:
|
|
48
|
-
https://www.reddit.com/r/Python/comments/1ioo4yd/bulletproof_wakewordkeyword_spotting/
|
|
49
|
-
|
|
50
49
|
- **Easy to deploy wake word with React Native:** Check out our example: "rn_example/DetectingKeyWords.js". With a few simple lines of code, you have your own keyword detecting enabled app.
|
|
51
50
|
- **Cross-Platform Support:** Integrate Davoice KeywordsDetection into React-Native Framework. Both iOS and Android are supported.
|
|
52
51
|
- **Low Latency:** Experience near-instantaneous keyword detection.
|
package/android/build.gradle
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
a1f8f0ccd4a36890e596d0b22f4ba7b7 keyworddetection-1.0.0.aar
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ecce4612759e9765cb1eec2dcddf74d9a0a59869 keyworddetection-1.0.0.aar
|
|
@@ -9,9 +9,5 @@
|
|
|
9
9
|
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
|
|
10
10
|
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
|
11
11
|
|
|
12
|
-
<!-- Required for microphone access in Android 14 -->
|
|
13
|
-
<uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT"/>
|
|
14
|
-
<uses-permission android:name="android.permission.CAPTURE_MEDIA_OUTPUT"/>
|
|
15
|
-
|
|
16
12
|
</manifest>
|
|
17
13
|
|
|
@@ -7,7 +7,7 @@ import com.facebook.react.uimanager.ViewManager;
|
|
|
7
7
|
|
|
8
8
|
// Your two existing modules:
|
|
9
9
|
import com.davoice.keywordspotting.KeyWordRNBridge;
|
|
10
|
-
import com.davoice.speakeridrn.SpeakerIdRNBridge;
|
|
10
|
+
//import com.davoice.speakeridrn.SpeakerIdRNBridge;
|
|
11
11
|
|
|
12
12
|
import java.util.Arrays;
|
|
13
13
|
import java.util.Collections;
|
|
@@ -17,8 +17,8 @@ public class DaVoiceUnifiedPackage implements ReactPackage {
|
|
|
17
17
|
@Override
|
|
18
18
|
public List<NativeModule> createNativeModules(ReactApplicationContext rc) {
|
|
19
19
|
return Arrays.asList(
|
|
20
|
-
new KeyWordRNBridge(rc)
|
|
21
|
-
new SpeakerIdRNBridge(rc)
|
|
20
|
+
new KeyWordRNBridge(rc)
|
|
21
|
+
// new SpeakerIdRNBridge(rc)
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -4,7 +4,6 @@ import com.davoice.keywordsdetection.keywordslibrary.KeyWordsDetection;
|
|
|
4
4
|
import com.facebook.react.bridge.*;
|
|
5
5
|
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
6
6
|
import androidx.annotation.Nullable;
|
|
7
|
-
import ai.onnxruntime.*;
|
|
8
7
|
import android.util.Log;
|
|
9
8
|
import java.util.HashMap;
|
|
10
9
|
import java.util.Map;
|
|
@@ -146,7 +145,7 @@ public class KeyWordRNBridge extends ReactContextBaseJavaModule {
|
|
|
146
145
|
|
|
147
146
|
// Start detection for a specific instance
|
|
148
147
|
@ReactMethod
|
|
149
|
-
public void startKeywordDetection(String instanceId, float threshold, Promise promise)
|
|
148
|
+
public void startKeywordDetection(String instanceId, float threshold, Promise promise) {
|
|
150
149
|
KeyWordsDetection instance = instances.get(instanceId);
|
|
151
150
|
if (instance != null) {
|
|
152
151
|
instance.startListening(threshold);
|
|
@@ -264,7 +263,8 @@ public void startVADDetection(String instanceId, Promise promise) {
|
|
|
264
263
|
// after: API-21 safe
|
|
265
264
|
Float _thr = vadThresholdByInstance.get(instanceId);
|
|
266
265
|
float thr = (_thr != null) ? _thr : DEFAULT_VAD_THRESHOLD;
|
|
267
|
-
|
|
266
|
+
Integer _win = vadMsWindowByInstance.get(instanceId);
|
|
267
|
+
int win = (_win != null) ? _win : DEFAULT_VAD_MSWINDOW;
|
|
268
268
|
instance.setVADParams(thr, win);
|
|
269
269
|
boolean ok = instance.startVADListening();
|
|
270
270
|
promise.resolve(ok);
|
|
@@ -313,8 +313,10 @@ public void getVADParams(String instanceId, Promise promise) {
|
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
315
315
|
WritableMap out = Arguments.createMap();
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
Float _thr = vadThresholdByInstance.get(instanceId);
|
|
317
|
+
float thr = (_thr != null) ? _thr : DEFAULT_VAD_THRESHOLD;
|
|
318
|
+
Integer _win = vadMsWindowByInstance.get(instanceId);
|
|
319
|
+
int win = (_win != null) ? _win : DEFAULT_VAD_MSWINDOW;
|
|
318
320
|
out.putDouble("threshold", (double) thr);
|
|
319
321
|
out.putInt("msWindow", win);
|
|
320
322
|
promise.resolve(out);
|
|
@@ -305,33 +305,20 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
305
305
|
|
|
306
306
|
#if defined(__OBJC__)
|
|
307
307
|
|
|
308
|
-
@class NSURL;
|
|
309
308
|
@class NSString;
|
|
310
309
|
SWIFT_CLASS("_TtC16KeyWordDetection29AudioSessionAndDuckingManager")
|
|
311
310
|
@interface AudioSessionAndDuckingManager : NSObject
|
|
312
311
|
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) AudioSessionAndDuckingManager * _Nonnull shared;)
|
|
313
312
|
+ (AudioSessionAndDuckingManager * _Nonnull)shared SWIFT_WARN_UNUSED_RESULT;
|
|
313
|
+
- (NSString * _Nullable)getWakewordAudioRoutingConfigJSONString SWIFT_WARN_UNUSED_RESULT;
|
|
314
|
+
- (void)setWakewordAudioRoutingConfigFromJSONString:(NSString * _Nonnull)jsonConfig;
|
|
314
315
|
- (void)initAudioSessAndDuckManage SWIFT_METHOD_FAMILY(none);
|
|
315
|
-
- (void)
|
|
316
|
-
/// Example function to end ducking. Deactivates session and stops engine.
|
|
317
|
-
- (void)_disableDucking;
|
|
316
|
+
- (void)enableRadioInCar;
|
|
318
317
|
- (void)enableAggressiveDucking;
|
|
319
|
-
- (void)
|
|
320
|
-
- (void)enableAggressiveDuckingWorksMaxSilencing;
|
|
321
|
-
- (void)enableAggressiveDuckingWorksOnSecondTime;
|
|
322
|
-
/// Example function to end ducking. Deactivates session and stops engine.
|
|
323
|
-
- (void)disableDuckingWorks;
|
|
324
|
-
- (void)disableDuckingDidNotUnDuck;
|
|
325
|
-
/// Example function to end ducking. Deactivates session and stops engine.
|
|
326
|
-
- (void)disableDuckingOrg;
|
|
318
|
+
- (void)disableDucking;
|
|
327
319
|
- (void)restartListeningAfterDucking;
|
|
328
320
|
/// Example function to end ducking. Deactivates session and stops engine.
|
|
329
321
|
- (void)disableDuckingAndCleanup;
|
|
330
|
-
/// BELOW IS FROM CHATGPT – XXX NOT TESTED AND PROBABLY BUGGY
|
|
331
|
-
- (void)activateSessionForDucking;
|
|
332
|
-
- (void)playInstructionSound:(NSURL * _Nonnull)soundURL;
|
|
333
|
-
- (void)speakInstruction:(NSString * _Nonnull)text;
|
|
334
|
-
- (void)deactivateSession;
|
|
335
322
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
336
323
|
@end
|
|
337
324
|
|
|
@@ -363,7 +350,7 @@ SWIFT_CLASS("_TtC16KeyWordDetection17KeyWordsDetection")
|
|
|
363
350
|
- (BOOL)setKeywordDetectionLicenseWithLicenseKey:(NSString * _Nonnull)licenseKey SWIFT_WARN_UNUSED_RESULT;
|
|
364
351
|
- (BOOL)setLicenseWithLicenseKey:(NSString * _Nonnull)licenseKey SWIFT_WARN_UNUSED_RESULT;
|
|
365
352
|
- (void)callBackWithFrame:(NSArray<NSNumber *> * _Nonnull)frame;
|
|
366
|
-
- (BOOL)
|
|
353
|
+
- (BOOL)startListeningWithNoExternalActivation:(BOOL)noExternalActivation duckOthers:(BOOL)duckOthers mixWithOthers:(BOOL)mixWithOthers defaultToSpeaker:(BOOL)defaultToSpeaker SWIFT_WARN_UNUSED_RESULT;
|
|
367
354
|
- (void)stopListening;
|
|
368
355
|
- (NSDictionary<NSString *, id> * _Nonnull)getVoiceProps SWIFT_WARN_UNUSED_RESULT;
|
|
369
356
|
- (BOOL)startSilentListening SWIFT_WARN_UNUSED_RESULT;
|
|
@@ -385,6 +372,51 @@ SWIFT_CLASS("_TtC16KeyWordDetection14LicenseManager")
|
|
|
385
372
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
386
373
|
@end
|
|
387
374
|
|
|
375
|
+
SWIFT_CLASS("_TtC16KeyWordDetection25SpeakerVerificationEngine")
|
|
376
|
+
@interface SpeakerVerificationEngine : NSObject
|
|
377
|
+
- (void)resetStreamingState;
|
|
378
|
+
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
379
|
+
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
380
|
+
@end
|
|
381
|
+
|
|
382
|
+
@protocol SpeakerVerificationNativeDelegate;
|
|
383
|
+
SWIFT_CLASS("_TtC16KeyWordDetection32SpeakerVerificationMicController")
|
|
384
|
+
@interface SpeakerVerificationMicController : NSObject
|
|
385
|
+
@property (nonatomic, weak) id <SpeakerVerificationNativeDelegate> _Nullable delegate;
|
|
386
|
+
- (BOOL)beginOnboardingWithEnrollmentId:(NSString * _Nonnull)enrollmentId targetEmbeddingCount:(NSInteger)targetEmbeddingCount reset:(BOOL)reset error:(NSError * _Nullable * _Nullable)error;
|
|
387
|
+
/// App calls this each time it wants ONE embedding to be captured from mic.
|
|
388
|
+
/// When collected, controller stops mic and notifies delegate.
|
|
389
|
+
- (BOOL)getNextEmbeddingFromMicAndReturnError:(NSError * _Nullable * _Nullable)error;
|
|
390
|
+
/// Optional explicit finalize (usually you rely on auto-finalize when target reached).
|
|
391
|
+
- (BOOL)finalizeOnboardingNowAndReturnError:(NSError * _Nullable * _Nullable)error;
|
|
392
|
+
- (BOOL)setEnrollmentJson:(NSString * _Nonnull)enrollmentJson error:(NSError * _Nullable * _Nullable)error;
|
|
393
|
+
/// Starts mic and returns first verification result (then stops mic).
|
|
394
|
+
- (BOOL)startVerifyFromMicWithResetState:(BOOL)resetState error:(NSError * _Nullable * _Nullable)error;
|
|
395
|
+
- (void)stop;
|
|
396
|
+
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
397
|
+
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
398
|
+
@end
|
|
399
|
+
|
|
400
|
+
SWIFT_PROTOCOL("_TtP16KeyWordDetection33SpeakerVerificationNativeDelegate_")
|
|
401
|
+
@protocol SpeakerVerificationNativeDelegate
|
|
402
|
+
- (void)svOnboardingProgress:(NSDictionary<NSString *, id> * _Nonnull)info;
|
|
403
|
+
- (void)svOnboardingDone:(NSDictionary<NSString *, id> * _Nonnull)info;
|
|
404
|
+
- (void)svVerifyResult:(NSDictionary<NSString *, id> * _Nonnull)info;
|
|
405
|
+
- (void)svError:(NSDictionary<NSString *, id> * _Nonnull)info;
|
|
406
|
+
@end
|
|
407
|
+
|
|
408
|
+
@class NSError;
|
|
409
|
+
SWIFT_CLASS_NAMED("SpeakerVerificationRNFacade")
|
|
410
|
+
@interface SpeakerVerificationRNFacade : NSObject
|
|
411
|
+
+ (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;
|
|
412
|
+
+ (NSDictionary<NSString *, id> * _Nullable)verifyWavWithEngine:(id _Nonnull)engine wavPath:(NSString * _Nonnull)wavPath reset:(BOOL)reset error:(NSError * _Nullable * _Nullable)outError SWIFT_WARN_UNUSED_RESULT;
|
|
413
|
+
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
414
|
+
@end
|
|
415
|
+
|
|
416
|
+
@interface SpeakerVerificationRNFacade (SWIFT_EXTENSION(KeyWordDetection))
|
|
417
|
+
+ (id _Nullable)createMicControllerWithConfigJson:(NSString * _Nonnull)configJson error:(NSError * _Nullable * _Nullable)outError SWIFT_WARN_UNUSED_RESULT;
|
|
418
|
+
@end
|
|
419
|
+
|
|
388
420
|
#endif
|
|
389
421
|
#if __has_attribute(external_source_symbol)
|
|
390
422
|
# pragma clang attribute pop
|
|
Binary file
|