react-native-wakeword 1.1.21 → 1.1.22
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/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/assets/coca_cola_model_28_05052025.onnx +0 -0
- package/android/src/main/java/com/davoice/keywordspotting/KeyWordRNBridge.java +45 -3
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/Info.plist +5 -5
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64/KeyWordDetection.framework/Headers/KeyWordDetection-Swift.h +4 -1
- 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 +345 -122
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/arm64-apple-ios.private.swiftinterface +5 -3
- 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 +5 -3
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Headers/KeyWordDetection-Swift.h +8 -2
- 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 +345 -122
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +5 -3
- 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 +5 -3
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/x86_64-apple-ios-simulator.abi.json +345 -122
- package/ios/KeyWordRNBridge/KeyWordDetection.xcframework/ios-arm64_x86_64-simulator/KeyWordDetection.framework/Modules/KeyWordDetection.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +5 -3
- 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 +5 -3
- 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.mm +64 -0
- package/ios/KeyWordRNBridge/models/coca_cola_model_28_05052025.onnx +0 -0
- package/package.json +1 -1
- package/wakewords/KeyWordRNBridge.d.ts +1 -0
- package/wakewords/KeyWordRNBridge.js +24 -1
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
dc061ad4032e82074b661cfe3f21e3cc keyworddetection-1.0.0.aar
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
f4f50053ac6ebc02add55625d8858eac815433ef keyworddetection-1.0.0.aar
|
|
Binary file
|
|
@@ -42,6 +42,46 @@ public class KeyWordRNBridge extends ReactContextBaseJavaModule {
|
|
|
42
42
|
promise.resolve(isLicesed);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
// Create a new instance efficiently
|
|
46
|
+
@ReactMethod
|
|
47
|
+
public void createInstanceMulti(String instanceId, ReadableArray modelPathsArray, ReadableArray thresholdsArray, ReadableArray bufferCntsArray, ReadableArray msBetweenCallbackArray, Promise promise) {
|
|
48
|
+
if (instances.containsKey(instanceId)) {
|
|
49
|
+
promise.reject("InstanceExists", "Instance already exists with ID: " + instanceId);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
int size = modelPathsArray.size();
|
|
55
|
+
if (thresholdsArray.size() != size || bufferCntsArray.size() != size || msBetweenCallbackArray.size() != size) {
|
|
56
|
+
promise.reject("InvalidArguments", "All input arrays must be the same length.");
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Convert ReadableArrays to Java arrays
|
|
61
|
+
String[] modelPaths = new String[size];
|
|
62
|
+
float[] thresholds = new float[size];
|
|
63
|
+
int[] bufferCnts = new int[size];
|
|
64
|
+
long[] msBetweenCallback = new long[size];
|
|
65
|
+
|
|
66
|
+
for (int i = 0; i < size; i++) {
|
|
67
|
+
modelPaths[i] = modelPathsArray.getString(i);
|
|
68
|
+
thresholds[i] = (float) thresholdsArray.getDouble(i);
|
|
69
|
+
bufferCnts[i] = bufferCntsArray.getInt(i);
|
|
70
|
+
msBetweenCallback[i] = (long) msBetweenCallbackArray.getDouble(i); // RN uses Double for all numbers
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Create instance
|
|
74
|
+
KeyWordsDetection keyWordsDetection = new KeyWordsDetection(reactContext, modelPaths, thresholds, bufferCnts, msBetweenCallback);
|
|
75
|
+
keyWordsDetection.initialize((detected, modelName) -> onKeywordDetected(instanceId, detected, modelName));
|
|
76
|
+
|
|
77
|
+
instances.put(instanceId, keyWordsDetection);
|
|
78
|
+
promise.resolve("Multi-model instance created with ID: " + instanceId);
|
|
79
|
+
|
|
80
|
+
} catch (Exception e) {
|
|
81
|
+
promise.reject("CreateError", "Failed to create multi-model instance: " + e.getMessage());
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
45
85
|
// Create a new instance
|
|
46
86
|
@ReactMethod
|
|
47
87
|
public void createInstance(String instanceId, String modelName, float threshold, int bufferCnt, Promise promise) {
|
|
@@ -52,7 +92,8 @@ public class KeyWordRNBridge extends ReactContextBaseJavaModule {
|
|
|
52
92
|
|
|
53
93
|
try {
|
|
54
94
|
KeyWordsDetection keyWordsDetection = new KeyWordsDetection(reactContext, modelName, threshold, bufferCnt);
|
|
55
|
-
keyWordsDetection.initialize(detected -> onKeywordDetected(instanceId, detected));
|
|
95
|
+
keyWordsDetection.initialize((detected, ignored) -> onKeywordDetected(instanceId, detected, modelName));
|
|
96
|
+
|
|
56
97
|
instances.put(instanceId, keyWordsDetection);
|
|
57
98
|
promise.resolve("Instance created with ID: " + instanceId);
|
|
58
99
|
} catch (Exception e) {
|
|
@@ -154,11 +195,12 @@ public class KeyWordRNBridge extends ReactContextBaseJavaModule {
|
|
|
154
195
|
}
|
|
155
196
|
|
|
156
197
|
// Handle keyword detection event
|
|
157
|
-
private void onKeywordDetected(String instanceId,
|
|
198
|
+
private void onKeywordDetected(String instanceId, boolean detected, String modelName) {
|
|
158
199
|
if (detected) {
|
|
159
200
|
WritableMap params = Arguments.createMap();
|
|
160
201
|
params.putString("instanceId", instanceId);
|
|
161
|
-
params.putString("phrase",
|
|
202
|
+
params.putString("phrase", modelName);
|
|
203
|
+
params.putString("modelName", modelName);
|
|
162
204
|
sendEvent("onKeywordDetectionEvent", params);
|
|
163
205
|
}
|
|
164
206
|
}
|
|
@@ -8,32 +8,32 @@
|
|
|
8
8
|
<key>BinaryPath</key>
|
|
9
9
|
<string>KeyWordDetection.framework/KeyWordDetection</string>
|
|
10
10
|
<key>LibraryIdentifier</key>
|
|
11
|
-
<string>ios-
|
|
11
|
+
<string>ios-arm64</string>
|
|
12
12
|
<key>LibraryPath</key>
|
|
13
13
|
<string>KeyWordDetection.framework</string>
|
|
14
14
|
<key>SupportedArchitectures</key>
|
|
15
15
|
<array>
|
|
16
16
|
<string>arm64</string>
|
|
17
|
-
<string>x86_64</string>
|
|
18
17
|
</array>
|
|
19
18
|
<key>SupportedPlatform</key>
|
|
20
19
|
<string>ios</string>
|
|
21
|
-
<key>SupportedPlatformVariant</key>
|
|
22
|
-
<string>simulator</string>
|
|
23
20
|
</dict>
|
|
24
21
|
<dict>
|
|
25
22
|
<key>BinaryPath</key>
|
|
26
23
|
<string>KeyWordDetection.framework/KeyWordDetection</string>
|
|
27
24
|
<key>LibraryIdentifier</key>
|
|
28
|
-
<string>ios-
|
|
25
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
29
26
|
<key>LibraryPath</key>
|
|
30
27
|
<string>KeyWordDetection.framework</string>
|
|
31
28
|
<key>SupportedArchitectures</key>
|
|
32
29
|
<array>
|
|
33
30
|
<string>arm64</string>
|
|
31
|
+
<string>x86_64</string>
|
|
34
32
|
</array>
|
|
35
33
|
<key>SupportedPlatform</key>
|
|
36
34
|
<string>ios</string>
|
|
35
|
+
<key>SupportedPlatformVariant</key>
|
|
36
|
+
<string>simulator</string>
|
|
37
37
|
</dict>
|
|
38
38
|
</array>
|
|
39
39
|
<key>CFBundlePackageType</key>
|
|
@@ -349,12 +349,15 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) GlobalVariab
|
|
|
349
349
|
@end
|
|
350
350
|
|
|
351
351
|
@protocol KeywordDetectionRNDelegate;
|
|
352
|
+
@class NSNumber;
|
|
352
353
|
SWIFT_CLASS("_TtC16KeyWordDetection17KeyWordsDetection")
|
|
353
354
|
@interface KeyWordsDetection : NSObject
|
|
354
355
|
@property (nonatomic, weak) id <KeywordDetectionRNDelegate> _Nullable delegate;
|
|
355
356
|
- (nullable instancetype)initWithModelPath:(NSString * _Nonnull)modelPath threshold:(float)threshold bufferCnt:(NSInteger)bufferCnt error:(NSError * _Nullable * _Nullable)error;
|
|
356
|
-
- (nullable instancetype)
|
|
357
|
+
- (nullable instancetype)initWithModelPaths:(NSArray<NSString *> * _Nonnull)modelPaths thresholds:(NSArray<NSNumber *> * _Nonnull)thresholds bufferCnts:(NSArray<NSNumber *> * _Nonnull)bufferCnts msBetweenCallback:(NSArray<NSNumber *> * _Nonnull)msBetweenCallback error:(NSError * _Nullable * _Nullable)error;
|
|
358
|
+
- (nullable instancetype)initWithModelPaths:(NSArray<NSString *> * _Nonnull)modelPaths thresholds:(NSArray<NSNumber *> * _Nonnull)thresholds bufferCnts:(NSArray<NSNumber *> * _Nonnull)bufferCnts msBetweenCallback:(NSArray<NSNumber *> * _Nonnull)msBetweenCallback cancelEcho:(BOOL)cancelEcho error:(NSError * _Nullable * _Nullable)error OBJC_DESIGNATED_INITIALIZER;
|
|
357
359
|
- (BOOL)replaceKeywordDetectionModelWithModelPath:(NSString * _Nonnull)modelPath threshold:(float)threshold bufferCnt:(NSInteger)bufferCnt error:(NSError * _Nullable * _Nullable)error;
|
|
360
|
+
- (BOOL)replaceKeywordDetectionModelsWithModelPaths:(NSArray<NSString *> * _Nonnull)modelPaths thresholds:(NSArray<NSNumber *> * _Nonnull)thresholds bufferCnts:(NSArray<NSNumber *> * _Nonnull)bufferCnts msBetweenCallback:(NSArray<NSNumber *> * _Nonnull)msBetweenCallback error:(NSError * _Nullable * _Nullable)error;
|
|
358
361
|
- (NSString * _Nonnull)getKeywordDetectionModel SWIFT_WARN_UNUSED_RESULT;
|
|
359
362
|
- (NSString * _Nonnull)getRecordingWav SWIFT_WARN_UNUSED_RESULT;
|
|
360
363
|
- (BOOL)setKeywordDetectionLicenseWithLicenseKey:(NSString * _Nonnull)licenseKey SWIFT_WARN_UNUSED_RESULT;
|
|
Binary file
|