react-native-wakeword 1.1.70 → 1.1.73
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
|
@@ -21,7 +21,15 @@ 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
|
-
|
|
24
|
+
/**
|
|
25
|
+
* @param {any} threshold
|
|
26
|
+
* @param {string | boolean | undefined} [speakerVerificationEnrollmentJsonOrPathOrSetActive]
|
|
27
|
+
* @param {boolean} [setActive]
|
|
28
|
+
* @param {boolean} [duckOthers]
|
|
29
|
+
* @param {boolean} [mixWithOthers]
|
|
30
|
+
* @param {boolean} [defaultToSpeaker]
|
|
31
|
+
*/
|
|
32
|
+
startKeywordDetection(threshold: any, speakerVerificationEnrollmentJsonOrPathOrSetActive?: string | boolean | undefined, setActive?: boolean, duckOthers?: boolean, mixWithOthers?: boolean, defaultToSpeaker?: boolean): Promise<any>;
|
|
25
33
|
getRecordingWavArray(): Promise<any>;
|
|
26
34
|
getRecordingWav(): Promise<any>;
|
|
27
35
|
stopKeywordDetection(): Promise<any>;
|
|
@@ -126,15 +126,28 @@ export class KeyWordRNBridgeInstance {
|
|
|
126
126
|
return KeyWordRNBridge.setKeywordLicense(this.instanceId, license);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
/**
|
|
130
|
+
* @param {any} threshold
|
|
131
|
+
* @param {string | boolean | undefined} [speakerVerificationEnrollmentJsonOrPathOrSetActive]
|
|
132
|
+
* @param {boolean} [setActive]
|
|
133
|
+
* @param {boolean} [duckOthers]
|
|
134
|
+
* @param {boolean} [mixWithOthers]
|
|
135
|
+
* @param {boolean} [defaultToSpeaker]
|
|
136
|
+
*/
|
|
129
137
|
async startKeywordDetection(
|
|
130
138
|
threshold,
|
|
131
|
-
speakerVerificationEnrollmentJsonOrPathOrSetActive =
|
|
139
|
+
speakerVerificationEnrollmentJsonOrPathOrSetActive = undefined,
|
|
132
140
|
setActive = true,
|
|
133
141
|
duckOthers = false,
|
|
134
142
|
mixWithOthers = true,
|
|
135
143
|
defaultToSpeaker = true
|
|
136
144
|
) {
|
|
137
|
-
|
|
145
|
+
/** @type {string | undefined} */
|
|
146
|
+
let speakerVerificationEnrollmentJsonOrPath = undefined;
|
|
147
|
+
let resolvedSetActive = setActive;
|
|
148
|
+
let resolvedDuckOthers = duckOthers;
|
|
149
|
+
let resolvedMixWithOthers = mixWithOthers;
|
|
150
|
+
let resolvedDefaultToSpeaker = defaultToSpeaker;
|
|
138
151
|
|
|
139
152
|
if (
|
|
140
153
|
typeof speakerVerificationEnrollmentJsonOrPathOrSetActive === 'string' ||
|
|
@@ -142,10 +155,7 @@ export class KeyWordRNBridgeInstance {
|
|
|
142
155
|
) {
|
|
143
156
|
speakerVerificationEnrollmentJsonOrPath = speakerVerificationEnrollmentJsonOrPathOrSetActive;
|
|
144
157
|
} else {
|
|
145
|
-
|
|
146
|
-
mixWithOthers = duckOthers;
|
|
147
|
-
duckOthers = setActive;
|
|
148
|
-
setActive = speakerVerificationEnrollmentJsonOrPathOrSetActive;
|
|
158
|
+
resolvedSetActive = speakerVerificationEnrollmentJsonOrPathOrSetActive;
|
|
149
159
|
}
|
|
150
160
|
|
|
151
161
|
if (Platform.OS === 'ios') {
|
|
@@ -153,10 +163,10 @@ export class KeyWordRNBridgeInstance {
|
|
|
153
163
|
this.instanceId,
|
|
154
164
|
threshold,
|
|
155
165
|
speakerVerificationEnrollmentJsonOrPath,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
166
|
+
resolvedSetActive,
|
|
167
|
+
resolvedDuckOthers,
|
|
168
|
+
resolvedMixWithOthers,
|
|
169
|
+
resolvedDefaultToSpeaker
|
|
160
170
|
);
|
|
161
171
|
} else {
|
|
162
172
|
return KeyWordRNBridge.startKeywordDetection(
|