react-native-wakeword 1.1.65 → 1.1.67

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.
@@ -1 +1 @@
1
- c7b14d38d80bc680c83823bebbd461a0 keyworddetection-1.0.0.aar
1
+ e3ed3e2d1e4f0fdf290f0974d23eb8aa keyworddetection-1.0.0.aar
@@ -1 +1 @@
1
- 71f4f06463961e707850de9bcf6c39b23f8aba7b keyworddetection-1.0.0.aar
1
+ ac32d0a227f675731ec7ef3aa4c5943ac00c5a68 keyworddetection-1.0.0.aar
@@ -250,6 +250,36 @@ public class KeyWordRNBridge extends ReactContextBaseJavaModule {
250
250
  }
251
251
  }
252
252
 
253
+ @ReactMethod
254
+ public void pauseDetection(String instanceId, boolean stopMic, Promise promise) {
255
+ KeyWordsDetection instance = instances.get(instanceId);
256
+ if (instance != null) {
257
+ try {
258
+ instance.pauseDetection(stopMic);
259
+ promise.resolve("Paused detection for instance: " + instanceId + " (stopMic=" + stopMic + ")");
260
+ } catch (Exception e) {
261
+ promise.reject("PauseDetectionError", "Failed to pause detection: " + e.getMessage());
262
+ }
263
+ } else {
264
+ promise.reject("InstanceNotFound", "No instance found with ID: " + instanceId);
265
+ }
266
+ }
267
+
268
+ @ReactMethod
269
+ public void unPauseDetection(String instanceId, Promise promise) {
270
+ KeyWordsDetection instance = instances.get(instanceId);
271
+ if (instance != null) {
272
+ try {
273
+ instance.unPauseDetection();
274
+ promise.resolve("Unpaused detection for instance: " + instanceId);
275
+ } catch (Exception e) {
276
+ promise.reject("UnPauseDetectionError", "Failed to unpause detection: " + e.getMessage());
277
+ }
278
+ } else {
279
+ promise.reject("InstanceNotFound", "No instance found with ID: " + instanceId);
280
+ }
281
+ }
282
+
253
283
  // Destroy an instance
254
284
  @ReactMethod
255
285
  public void destroyInstance(String instanceId, Promise promise) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-wakeword",
3
- "version": "1.1.65",
3
+ "version": "1.1.67",
4
4
  "description": "Voice/Wake-word detection library for React Native",
5
5
  "main": "wakewords/index.js",
6
6
  "types": "wakewords/index.d.ts",