react-native-wakeword 1.1.69 → 1.1.70
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/android/libs/com/davoice/keyworddetection/1.0.0/keyworddetection-1.0.0.aar +0 -0
- package/android/libs/com/davoice/keyworddetection/1.0.0/keyworddetection-1.0.0.aar.md5 +1 -1
- package/android/libs/com/davoice/keyworddetection/1.0.0/keyworddetection-1.0.0.aar.sha1 +1 -1
- package/android/src/main/java/com/davoice/keywordspotting/KeyWordRNBridge.java +7 -3
- package/package.json +1 -1
- package/wakewords/KeyWordRNBridge.d.ts +3 -1
- package/wakewords/KeyWordRNBridge.js +32 -3
- package/wakewords/index.d.ts +2 -0
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
7d4c3a558c778d6680100e99ffaf47a4 keyworddetection-1.0.0.aar
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
5665687359d31955083b51b1062dc19507b873ed keyworddetection-1.0.0.aar
|
|
@@ -204,11 +204,15 @@ public class KeyWordRNBridge extends ReactContextBaseJavaModule {
|
|
|
204
204
|
|
|
205
205
|
// Start detection for a specific instance
|
|
206
206
|
@ReactMethod
|
|
207
|
-
public void startKeywordDetection(String instanceId, float threshold, Promise promise) {
|
|
207
|
+
public void startKeywordDetection(String instanceId, float threshold, @Nullable String speakerVerificationEnrollmentJsonOrPath, Promise promise) {
|
|
208
208
|
KeyWordsDetection instance = instances.get(instanceId);
|
|
209
209
|
if (instance != null) {
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
try {
|
|
211
|
+
instance.startListening(threshold, speakerVerificationEnrollmentJsonOrPath);
|
|
212
|
+
promise.resolve("Started detection for instance: " + instanceId);
|
|
213
|
+
} catch (Exception e) {
|
|
214
|
+
promise.reject("StartDetectionError", "Failed to start detection: " + e.getMessage());
|
|
215
|
+
}
|
|
212
216
|
} else {
|
|
213
217
|
promise.reject("InstanceNotFound", "No instance found with ID: " + instanceId);
|
|
214
218
|
}
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ export class KeyWordRNBridgeInstance {
|
|
|
21
21
|
setKeywordDetectionLicense(license: any): Promise<any>;
|
|
22
22
|
replaceKeywordDetectionModel(modelName: any, threshold: any, bufferCnt: any): Promise<any>;
|
|
23
23
|
setKeywordLicense(license: any): Promise<any>;
|
|
24
|
-
startKeywordDetection(threshold: any, setActive?: boolean, duckOthers?: boolean, mixWithOthers?: boolean, defaultToSpeaker?: boolean): Promise<any>;
|
|
24
|
+
startKeywordDetection(threshold: any, speakerVerificationEnrollmentJsonOrPathOrSetActive?: null, setActive?: boolean, duckOthers?: boolean, mixWithOthers?: boolean, defaultToSpeaker?: boolean): Promise<any>;
|
|
25
25
|
getRecordingWavArray(): Promise<any>;
|
|
26
26
|
getRecordingWav(): Promise<any>;
|
|
27
27
|
stopKeywordDetection(): Promise<any>;
|
|
@@ -32,6 +32,8 @@ export class KeyWordRNBridgeInstance {
|
|
|
32
32
|
removeListeners(): void;
|
|
33
33
|
}
|
|
34
34
|
export function removeAllRNBridgeListeners(): Promise<void>;
|
|
35
|
+
export function pauseDetection(instanceId: any, stopMic?: boolean): Promise<any>;
|
|
36
|
+
export function unPauseDetection(instanceId: any): Promise<any>;
|
|
35
37
|
export function createKeyWordRNBridgeInstance(instanceId: any, isSticky: any): Promise<KeyWordRNBridgeInstance>;
|
|
36
38
|
export function enableDucking(): Promise<void>;
|
|
37
39
|
export function disableDucking(): Promise<void>;
|
|
@@ -126,23 +126,44 @@ export class KeyWordRNBridgeInstance {
|
|
|
126
126
|
return KeyWordRNBridge.setKeywordLicense(this.instanceId, license);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
async startKeywordDetection(
|
|
129
|
+
async startKeywordDetection(
|
|
130
|
+
threshold,
|
|
131
|
+
speakerVerificationEnrollmentJsonOrPathOrSetActive = null,
|
|
130
132
|
setActive = true,
|
|
131
133
|
duckOthers = false,
|
|
132
134
|
mixWithOthers = true,
|
|
133
|
-
defaultToSpeaker = true
|
|
135
|
+
defaultToSpeaker = true
|
|
136
|
+
) {
|
|
137
|
+
let speakerVerificationEnrollmentJsonOrPath = null;
|
|
138
|
+
|
|
139
|
+
if (
|
|
140
|
+
typeof speakerVerificationEnrollmentJsonOrPathOrSetActive === 'string' ||
|
|
141
|
+
speakerVerificationEnrollmentJsonOrPathOrSetActive == null
|
|
142
|
+
) {
|
|
143
|
+
speakerVerificationEnrollmentJsonOrPath = speakerVerificationEnrollmentJsonOrPathOrSetActive;
|
|
144
|
+
} else {
|
|
145
|
+
defaultToSpeaker = mixWithOthers;
|
|
146
|
+
mixWithOthers = duckOthers;
|
|
147
|
+
duckOthers = setActive;
|
|
148
|
+
setActive = speakerVerificationEnrollmentJsonOrPathOrSetActive;
|
|
149
|
+
}
|
|
134
150
|
|
|
135
151
|
if (Platform.OS === 'ios') {
|
|
136
152
|
return KeyWordRNBridge.startKeywordDetection(
|
|
137
153
|
this.instanceId,
|
|
138
154
|
threshold,
|
|
155
|
+
speakerVerificationEnrollmentJsonOrPath,
|
|
139
156
|
setActive,
|
|
140
157
|
duckOthers,
|
|
141
158
|
mixWithOthers,
|
|
142
159
|
defaultToSpeaker
|
|
143
160
|
);
|
|
144
161
|
} else {
|
|
145
|
-
return KeyWordRNBridge.startKeywordDetection(
|
|
162
|
+
return KeyWordRNBridge.startKeywordDetection(
|
|
163
|
+
this.instanceId,
|
|
164
|
+
threshold,
|
|
165
|
+
speakerVerificationEnrollmentJsonOrPath
|
|
166
|
+
);
|
|
146
167
|
}
|
|
147
168
|
}
|
|
148
169
|
|
|
@@ -197,6 +218,14 @@ export const removeAllRNBridgeListeners = async () => {
|
|
|
197
218
|
keywordRNBridgeEmitter.removeAllListeners('onVADDetectionEvent'); // NEW
|
|
198
219
|
}
|
|
199
220
|
|
|
221
|
+
export const pauseDetection = async (instanceId, stopMic = false) => {
|
|
222
|
+
return KeyWordRNBridge.pauseDetection(instanceId, stopMic);
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export const unPauseDetection = async (instanceId) => {
|
|
226
|
+
return KeyWordRNBridge.unPauseDetection(instanceId);
|
|
227
|
+
};
|
|
228
|
+
|
|
200
229
|
export const createKeyWordRNBridgeInstance = async (instanceId, isSticky) => {
|
|
201
230
|
return await new KeyWordRNBridgeInstance(instanceId, isSticky);
|
|
202
231
|
};
|
package/wakewords/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { enableDucking } from './KeyWordRNBridge';
|
|
|
3
3
|
import { disableDucking } from './KeyWordRNBridge';
|
|
4
4
|
import { initAudioSessAndDuckManage } from './KeyWordRNBridge';
|
|
5
5
|
import { restartListeningAfterDucking } from './KeyWordRNBridge';
|
|
6
|
+
import { pauseDetection } from './KeyWordRNBridge';
|
|
7
|
+
import { unPauseDetection } from './KeyWordRNBridge';
|
|
6
8
|
import { removeAllRNBridgeListeners } from './KeyWordRNBridge';
|
|
7
9
|
import { createKeyWordRNBridgeInstance } from './KeyWordRNBridge';
|
|
8
10
|
import { KeyWordRNBridgeInstance } from './KeyWordRNBridge';
|