Skip to content

Commit b2ff8c6

Browse files
committed
Added v1.3.0 options to node wrapper [publish binary]
1 parent bff91f6 commit b2ff8c6

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

lib/node/SnowboyDetectNative.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ interface SnowboyDetectNativeInterface {
33
Reset(): boolean;
44
RunDetection(audioData: Buffer): number;
55
SetSensitivity(sensitivity: string): void;
6+
SetHighSensitivity(highSensitivity: string): void;
67
GetSensitivity(): string;
78
SetAudioGain(audioGain: number): void;
89
UpdateModel(): void;

lib/node/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ export interface DetectorOptions {
3434
models: HotwordModels;
3535
audioGain?: number;
3636
applyFrontend?: boolean;
37+
highSensitivity?: string;
3738
}
3839

3940
export interface SnowboyDetectInterface {
4041
reset(): boolean;
4142
runDetection(buffer: Buffer): number;
4243
setSensitivity(sensitivity: string): void;
44+
setHighSensitivity(highSensitivity: string): void;
4345
getSensitivity(): string;
4446
setAudioGain(gain: number): void;
4547
updateModel(): void;
@@ -121,6 +123,10 @@ export class SnowboyDetect extends stream.Writable implements SnowboyDetectInter
121123
if (options.applyFrontend) {
122124
this.nativeInstance.ApplyFrontend(options.applyFrontend);
123125
}
126+
127+
if (options.highSensitivity) {
128+
this.nativeInstance.SetHighSensitivity(options.highSensitivity);
129+
}
124130
}
125131

126132
reset(): boolean {
@@ -137,6 +143,10 @@ export class SnowboyDetect extends stream.Writable implements SnowboyDetectInter
137143
this.nativeInstance.SetSensitivity(sensitivity);
138144
}
139145

146+
setHighSensitivity(highSensitivity: string): void {
147+
this.nativeInstance.SetHighSensitivity(highSensitivity);
148+
}
149+
140150
getSensitivity(): string {
141151
return this.nativeInstance.GetSensitivity();
142152
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "snowboy",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "Snowboy is a customizable hotword detection engine",
55
"main": "lib/node/index.js",
66
"typings": "lib/node/index.d.ts",

0 commit comments

Comments
 (0)