react-native-wakeword-sid 1.1.102 → 1.1.105

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
- 9254ff04488a759290e2498b3deaaa2d keyworddetection-1.0.0.aar
1
+ 66b5a4f6201e3d7c7d71c3d9891bba82 keyworddetection-1.0.0.aar
@@ -1 +1 @@
1
- 72e064d55b4c80a6396644542bd47a3313b76fe0 keyworddetection-1.0.0.aar
1
+ 016cdcd6f0f4309c8d8ce5c694269a7d6cd00142 keyworddetection-1.0.0.aar
@@ -261,7 +261,9 @@ public void startVADDetection(String instanceId, Promise promise) {
261
261
  return;
262
262
  }
263
263
  try {
264
- float thr = vadThresholdByInstance.getOrDefault(instanceId, DEFAULT_VAD_THRESHOLD);
264
+ // after: API-21 safe
265
+ Float _thr = vadThresholdByInstance.get(instanceId);
266
+ float thr = (_thr != null) ? _thr : DEFAULT_VAD_THRESHOLD;
265
267
  int win = vadMsWindowByInstance.getOrDefault(instanceId, DEFAULT_VAD_MSWINDOW);
266
268
  instance.setVADParams(thr, win);
267
269
  boolean ok = instance.startVADListening();
@@ -24,7 +24,7 @@ import java.io.BufferedInputStream;
24
24
  import java.io.ByteArrayOutputStream;
25
25
  import java.io.IOException;
26
26
  import java.util.Locale;
27
- import java.util.Log;
27
+ import android.util.Log;
28
28
 
29
29
  /**
30
30
  * React Native bridge for the speaker-id Android library.
@@ -390,19 +390,19 @@ public class SpeakerIdRNBridge extends ReactContextBaseJavaModule {
390
390
  promise.reject("InstanceExists", "Instance already exists: " + instanceId);
391
391
  return;
392
392
  }
393
- Log.d("WWD DEBUG", "createInstanceWWD")
393
+ Log.d("WWD DEBUG", "createInstanceWWD");
394
394
 
395
395
  exec.submit(() -> {
396
396
  try {
397
- Log.d("WWD DEBUG", "createInstanceWWD2")
397
+ Log.d("WWD DEBUG", "createInstanceWWD2");
398
398
  SpeakerIdApi api = SpeakerIdApi.createWWD(reactContext);
399
- Log.d("WWD DEBUG", "createInstanceWWD3")
399
+ Log.d("WWD DEBUG", "createInstanceWWD3");
400
400
  synchronized (instances) { instances.put(instanceId, api); }
401
- Log.d("WWD DEBUG", "createInstanceWWD4")
401
+ Log.d("WWD DEBUG", "createInstanceWWD4");
402
402
  main.post(() -> promise.resolve(true));
403
403
  // Then run debug async if enabled
404
404
  if (DEBUG_SID_ASSETS) {
405
- Log.d("WWD DEBUG", "Calling debugOnAssetsWWD")
405
+ Log.d("WWD DEBUG", "Calling debugOnAssetsWWD");
406
406
  exec.submit(() -> debugOnAssetsWWD(instanceId));
407
407
  }
408
408
 
@@ -514,7 +514,7 @@ public class SpeakerIdRNBridge extends ReactContextBaseJavaModule {
514
514
  // ======= DEBUG harness (assets) =======
515
515
 
516
516
  private void emitDebug(String msg) {
517
- Log.d("WWD DEBUG", msg)
517
+ Log.d("WWD DEBUG", msg);
518
518
  WritableMap m = Arguments.createMap();
519
519
  m.putString("line", msg);
520
520
  sendEvent("SpeakerIdDebug", m);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-wakeword-sid",
3
- "version": "1.1.102",
3
+ "version": "1.1.105",
4
4
  "description": "Voice/Wake-word detection library for React Native",
5
5
  "main": "wakewords/index.js",
6
6
  "types": "wakewords/index.d.ts",