react-native-wakeword-sid 1.1.202 → 1.1.203
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.
|
@@ -765,39 +765,39 @@ RCT_EXPORT_METHOD(svStartVerifyFromMic:(NSString *)controllerId
|
|
|
765
765
|
}
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
768
|
+
// startEndlessVerifyFromMic(hopSeconds, stopOnMatch): starts mic and keeps verifying repeatedly.
|
|
769
|
+
// Results delivered via event: onSpeakerVerificationVerifyResult
|
|
770
|
+
RCT_EXPORT_METHOD(svStartEndlessVerifyFromMic:(NSString *)controllerId
|
|
771
|
+
hopSeconds:(nonnull NSNumber *)hopSeconds
|
|
772
|
+
stopOnMatch:(BOOL)stopOnMatch
|
|
773
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
774
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
775
|
+
{
|
|
776
|
+
SVMicHolder *h = self.speakerMicControllers[controllerId];
|
|
777
|
+
if (!h || !h.controller) {
|
|
778
|
+
reject(@"SVMicNotFound", [NSString stringWithFormat:@"No speaker mic controller with ID: %@", controllerId], nil);
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
|
782
|
+
@autoreleasepool {
|
|
783
|
+
NSError *err = nil;
|
|
784
|
+
SEL sel = NSSelectorFromString(@"startEndlessVerifyFromMicWithHopSeconds:stopOnMatch:error:");
|
|
785
|
+
if (![h.controller respondsToSelector:sel]) {
|
|
786
|
+
reject(@"SVMicMissingSelector", @"Mic controller missing startEndlessVerifyFromMicWithHopSeconds:stopOnMatch:error:", nil);
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
BOOL ok = SVCallBoolHopStop(h.controller, sel, hopSeconds, stopOnMatch, &err);
|
|
790
|
+
if (!ok || err) {
|
|
791
|
+
reject(@"SVMicStartEndlessVerifyError",
|
|
792
|
+
[NSString stringWithFormat:@"startEndlessVerifyFromMic failed: %@", err.localizedDescription ?: @"unknown"],
|
|
793
|
+
err);
|
|
794
|
+
return;
|
|
795
|
+
}
|
|
796
|
+
resolve(@{ @"ok": @YES, @"controllerId": controllerId, @"hopSeconds": hopSeconds, @"stopOnMatch": @(stopOnMatch) });
|
|
797
|
+
}
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
|
|
801
801
|
|
|
802
802
|
// stop(): stop mic immediately
|
|
803
803
|
RCT_EXPORT_METHOD(svStopMic:(NSString *)controllerId
|