react-native-wakeword 1.1.24 → 1.1.26
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.
|
@@ -366,16 +366,28 @@ RCT_EXPORT_METHOD(stopVADDetection:(NSString *)instanceId resolver:(RCTPromiseRe
|
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
|
|
370
|
-
|
|
369
|
+
RCT_EXPORT_METHOD(setVADParams:(NSString *)instanceId
|
|
370
|
+
threshold:(float)threshold
|
|
371
|
+
msWindow:(NSInteger)msWindow
|
|
372
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
373
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
371
374
|
{
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
375
|
+
KeyWordsDetectionWrapper *wrapper = self.instances[instanceId];
|
|
376
|
+
if (wrapper && wrapper.keyWordsDetection) {
|
|
377
|
+
NSError *err = nil;
|
|
378
|
+
BOOL ok = [wrapper.keyWordsDetection setVADParamsWithThreshold:threshold
|
|
379
|
+
msWindow:msWindow
|
|
380
|
+
error:&err];
|
|
381
|
+
if (!ok || err) {
|
|
382
|
+
reject(@"VADParamsError",
|
|
383
|
+
err ? err.localizedDescription : @"Failed to set VAD params",
|
|
384
|
+
err);
|
|
376
385
|
} else {
|
|
377
|
-
|
|
386
|
+
resolve(@"VAD params updated");
|
|
378
387
|
}
|
|
388
|
+
} else {
|
|
389
|
+
reject(@"InstanceNotFound", @"No instance found", nil);
|
|
390
|
+
}
|
|
379
391
|
}
|
|
380
392
|
|
|
381
393
|
// You can add more methods here as needed, ensuring they use the instanceId
|