react-native-wakeword-sid 1.1.56 → 1.1.57

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-wakeword-sid",
3
- "version": "1.1.56",
3
+ "version": "1.1.57",
4
4
  "description": "Voice/Wake-word detection library for React Native",
5
5
  "main": "wakewords/index.js",
6
6
  "types": "wakewords/index.d.ts",
@@ -5,6 +5,11 @@ import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource'
5
5
  // Keep using the SAME native module (KeyWordRNBridge.m already exports these methods)
6
6
  const { KeyWordRNBridge } = NativeModules;
7
7
  const emitter = KeyWordRNBridge ? new NativeEventEmitter(KeyWordRNBridge) : null;
8
+ +const VERBOSE = true;
9
+ +const PFX = '[SVJS]';
10
+ +const ts = () => new Date().toISOString();
11
+ +function dbg(...args) { if (VERBOSE) console.log(ts(), PFX, ...args); }
12
+ +function dbgErr(...args) { console.log(ts(), PFX, '❌', ...args); }
8
13
 
9
14
  function stripFileScheme(uri) {
10
15
  if (!uri) return uri;
@@ -76,6 +81,9 @@ export class SpeakerVerificationRNBridgeInstance {
76
81
  const modelArg = normalizePathOrName(modelPathOrName);
77
82
  const jsonArg = normalizePathOrName(enrollmentJsonPathOrName);
78
83
 
84
+ dbg('createSpeakerVerifier args:',
85
+ { engineId: this.engineId, modelArg, jsonArg, options });
86
+
79
87
  return await KeyWordRNBridge.createSpeakerVerifier(
80
88
  this.engineId,
81
89
  modelArg,
@@ -99,6 +107,7 @@ export class SpeakerVerificationRNBridgeInstance {
99
107
  assertMethod('verifySpeakerWavStreaming');
100
108
 
101
109
  const wavArg = normalizePathOrName(wavPathOrName);
110
+ dbg('verifySpeakerWavStreaming args:', { engineId: this.engineId, wavArg, resetState: !!resetState });
102
111
 
103
112
  return await KeyWordRNBridge.verifySpeakerWavStreaming(
104
113
  this.engineId,
@@ -140,15 +149,20 @@ export class SpeakerVerificationMicController {
140
149
  typeof configJson === 'string'
141
150
  ? configJson
142
151
  : JSON.stringify(configJson ?? {});
143
- return await KeyWordRNBridge.createSpeakerVerificationMicController(
144
- this.controllerId,
145
- cfg
146
- );
152
+ // IMPORTANT: must pass a REAL JSON string, not "[object Object]"
153
+ const jsonStr = (typeof configJson === 'string')
154
+ ? configJson
155
+ : JSON.stringify(configJson ?? {});
156
+ dbg('createSpeakerVerificationMicController args:',
157
+ { controllerId: this.controllerId, jsonStrLen: jsonStr.length, jsonStr });
158
+ return await KeyWordRNBridge.createSpeakerVerificationMicController(this.controllerId, jsonStr);
147
159
  }
148
160
 
149
161
  async beginOnboarding(enrollmentId, targetEmbeddingCount, reset = true) {
150
162
  assertIOS();
151
163
  assertMethod('svBeginOnboarding');
164
+ dbg('svBeginOnboarding args:', { controllerId: this.controllerId, enrollmentId, targetEmbeddingCount, reset: !!reset });
165
+
152
166
  return await KeyWordRNBridge.svBeginOnboarding(
153
167
  this.controllerId,
154
168
  String(enrollmentId ?? ''),
@@ -160,18 +174,24 @@ export class SpeakerVerificationMicController {
160
174
  async getNextEmbeddingFromMic() {
161
175
  assertIOS();
162
176
  assertMethod('svGetNextEmbeddingFromMic');
177
+ dbg('svGetNextEmbeddingFromMic args:', { controllerId: this.controllerId });
178
+
163
179
  return await KeyWordRNBridge.svGetNextEmbeddingFromMic(this.controllerId);
164
180
  }
165
181
 
166
182
  async finalizeOnboardingNow() {
167
183
  assertIOS();
168
184
  assertMethod('svFinalizeOnboardingNow');
185
+ dbg('svFinalizeOnboardingNow args:', { controllerId: this.controllerId });
186
+
169
187
  return await KeyWordRNBridge.svFinalizeOnboardingNow(this.controllerId);
170
188
  }
171
189
 
172
190
  async setEnrollmentJson(enrollmentJson) {
173
191
  assertIOS();
174
192
  assertMethod('svSetEnrollmentJson');
193
+ dbg('svSetEnrollmentJson args:', { controllerId: this.controllerId, len: String(enrollmentJson ?? '').length });
194
+
175
195
  // if caller passes object, stringify it (native expects JSON string)
176
196
  const s =
177
197
  typeof enrollmentJson === 'string'
@@ -187,6 +207,8 @@ export class SpeakerVerificationMicController {
187
207
  async startVerifyFromMic(resetState = true) {
188
208
  assertIOS();
189
209
  assertMethod('svStartVerifyFromMic');
210
+ dbg('svStartVerifyFromMic args:', { controllerId: this.controllerId, resetState: !!resetState });
211
+
190
212
  return await KeyWordRNBridge.svStartVerifyFromMic(
191
213
  this.controllerId,
192
214
  !!resetState
@@ -17,6 +17,3 @@ import { onSpeakerVerificationVerifyResult } from './SpeakerVerificationRNBridge
17
17
  import { onSpeakerVerificationError } from './SpeakerVerificationRNBridge';
18
18
  import useModel from './useModel';
19
19
  export { enableDucking, disableDucking, initAudioSessAndDuckManage, restartListeningAfterDucking, removeAllRNBridgeListeners, createKeyWordRNBridgeInstance, KeyWordRNBridgeInstance, setWakewordAudioRoutingConfig, createSpeakerVerificationInstance, SpeakerVerificationRNBridgeInstance, createSpeakerVerificationMicController, SpeakerVerificationMicController, onSpeakerVerificationOnboardingProgress, onSpeakerVerificationOnboardingDone, onSpeakerVerificationVerifyResult, onSpeakerVerificationError, useModel };
20
-
21
- // Re-export routing types for consumers:
22
- export type { AudioRoutingConfig, RouteConfigEntry } from './audioRoutingConfig';