react-native-wakeword 1.1.58 → 1.1.60

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
- 4aa9fcc3263f94da6f26d70e024edb55 keyworddetection-1.0.0.aar
1
+ ed65595f5ecff20ba88118c1b6482e04 keyworddetection-1.0.0.aar
@@ -1 +1 @@
1
- 1b46b16ef432495c4ac34228799b65d6cc060b92 keyworddetection-1.0.0.aar
1
+ 322520afefcf90ae48808b0f61d0aee95d233195 keyworddetection-1.0.0.aar
@@ -154,6 +154,7 @@ public class KeyWordRNBridge extends ReactContextBaseJavaModule {
154
154
  String recordingWav = "";
155
155
  if (instance == null) {
156
156
  promise.reject("Instance not Exists", "Instance does not exists with ID: " + instanceId);
157
+ return;
157
158
  }
158
159
  try {
159
160
  recordingWav = instance.getRecordingWav();
@@ -163,6 +164,27 @@ public class KeyWordRNBridge extends ReactContextBaseJavaModule {
163
164
  }
164
165
  }
165
166
 
167
+ @ReactMethod
168
+ public void getRecordingWavArray(String instanceId, Promise promise) {
169
+ KeyWordsDetection instance = instances.get(instanceId);
170
+ if (instance == null) {
171
+ promise.reject("Instance not Exists", "Instance does not exists with ID: " + instanceId);
172
+ return;
173
+ }
174
+ try {
175
+ String[] recordingWavs = instance.getRecordingWavArray();
176
+ WritableArray out = Arguments.createArray();
177
+ if (recordingWavs != null) {
178
+ for (String recordingWav : recordingWavs) {
179
+ out.pushString(recordingWav);
180
+ }
181
+ }
182
+ promise.resolve(out);
183
+ } catch (Exception e) {
184
+ promise.reject("GetRecordingWavArrayError", "Failed to get recording WAV array: " + e.getMessage());
185
+ }
186
+ }
187
+
166
188
  // Create a new instance
167
189
  @ReactMethod
168
190
  public void replaceKeywordDetectionModel(String instanceId, String modelName, float threshold, int bufferCnt, Promise promise) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-wakeword",
3
- "version": "1.1.58",
3
+ "version": "1.1.60",
4
4
  "description": "Voice/Wake-word detection library for React Native",
5
5
  "main": "wakewords/index.js",
6
6
  "types": "wakewords/index.d.ts",
@@ -22,6 +22,7 @@ export class KeyWordRNBridgeInstance {
22
22
  replaceKeywordDetectionModel(modelName: any, threshold: any, bufferCnt: any): Promise<any>;
23
23
  setKeywordLicense(license: any): Promise<any>;
24
24
  startKeywordDetection(threshold: any, setActive?: boolean, duckOthers?: boolean, mixWithOthers?: boolean, defaultToSpeaker?: boolean): Promise<any>;
25
+ getRecordingWavArray(): Promise<any>;
25
26
  getRecordingWav(): Promise<any>;
26
27
  stopKeywordDetection(): Promise<any>;
27
28
  destroyInstance(): Promise<any>;
@@ -146,6 +146,10 @@ export class KeyWordRNBridgeInstance {
146
146
  }
147
147
  }
148
148
 
149
+ async getRecordingWavArray() {
150
+ return await KeyWordRNBridge.getRecordingWavArray(this.instanceId);
151
+ }
152
+
149
153
  async getRecordingWav() {
150
154
  return await KeyWordRNBridge.getRecordingWav(this.instanceId);
151
155
  }
@@ -39,6 +39,7 @@ export class SpeakerVerificationMicController {
39
39
  finalizeOnboardingNow(): Promise<any>;
40
40
  setEnrollmentJson(enrollmentJson: any): Promise<any>;
41
41
  startVerifyFromMic(resetState?: boolean): Promise<any>;
42
+ startEndlessVerifyFromMic(hopSeconds?: number, stopOnMatch?: boolean): Promise<any>;
42
43
  stop(): Promise<any>;
43
44
  destroy(): Promise<any>;
44
45
  }
@@ -198,6 +198,16 @@ export class SpeakerVerificationMicController {
198
198
  !!resetState
199
199
  );
200
200
  }
201
+
202
+ async startEndlessVerifyFromMic(hopSeconds = 0.5, stopOnMatch = false) {
203
+ assertMethod('svStartEndlessVerifyFromMic');
204
+ dbg('svStartEndlessVerifyFromMic args:', { controllerId: this.controllerId, hopSeconds, stopOnMatch });
205
+ return await KeyWordRNBridge.svStartEndlessVerifyFromMic(
206
+ this.controllerId,
207
+ Number(hopSeconds),
208
+ !!stopOnMatch
209
+ );
210
+ }
201
211
 
202
212
  async stop() {
203
213
  assertMethod('svStopMic');