@fonoster/autopilot 0.9.38 → 0.9.40
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/dist/Autopilot.d.ts +2 -1
- package/dist/Autopilot.js +15 -3
- package/dist/envs.d.ts +0 -1
- package/dist/envs.js +1 -6
- package/dist/handleVoiceRequest.js +1 -1
- package/dist/vad/SileroVad.d.ts +3 -3
- package/dist/vad/SileroVad.js +2 -2
- package/dist/vad/SileroVadModel.d.ts +7 -8
- package/dist/vad/SileroVadModel.js +34 -16
- package/dist/vad/createVad.d.ts +1 -1
- package/dist/vad/createVad.js +33 -19
- package/dist/vad/types.d.ts +28 -12
- package/dist/vadWorker.js +6 -11
- package/package.json +3 -3
- package/dist/vadv5/SileroVad.d.ts +0 -18
- package/dist/vadv5/SileroVad.js +0 -40
- package/dist/vadv5/SileroVadModel.d.ts +0 -14
- package/dist/vadv5/SileroVadModel.js +0 -79
- package/dist/vadv5/createVad.d.ts +0 -3
- package/dist/vadv5/createVad.js +0 -120
- package/dist/vadv5/index.d.ts +0 -20
- package/dist/vadv5/index.js +0 -36
- package/dist/vadv5/types.d.ts +0 -53
- package/dist/vadv5/types.js +0 -2
- package/silero_vad.onnx +0 -0
package/dist/Autopilot.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ declare class Autopilot {
|
|
|
3
3
|
private readonly params;
|
|
4
4
|
private readonly actor;
|
|
5
5
|
private readonly vadWorker;
|
|
6
|
+
private vadWorkerReady;
|
|
6
7
|
constructor(params: AutopilotParams);
|
|
7
|
-
start(): void
|
|
8
|
+
start(): Promise<void>;
|
|
8
9
|
stop(): void;
|
|
9
10
|
private setupVoiceStream;
|
|
10
11
|
private handleVoicePayload;
|
package/dist/Autopilot.js
CHANGED
|
@@ -36,6 +36,16 @@ class Autopilot {
|
|
|
36
36
|
this.vadWorker = new worker_threads_1.Worker(vadWorkerPath, {
|
|
37
37
|
workerData: conversationSettings.vad
|
|
38
38
|
});
|
|
39
|
+
this.vadWorkerReady = new Promise((resolve, reject) => {
|
|
40
|
+
logger.verbose("waiting for vad worker to be ready");
|
|
41
|
+
this.vadWorker.once("message", (message) => {
|
|
42
|
+
if (message === "VAD_READY") {
|
|
43
|
+
logger.verbose("vad worker is ready");
|
|
44
|
+
resolve();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
this.vadWorker.once("error", reject);
|
|
48
|
+
});
|
|
39
49
|
this.actor = (0, xstate_1.createActor)(machine_1.machine, {
|
|
40
50
|
input: {
|
|
41
51
|
conversationSettings,
|
|
@@ -44,13 +54,15 @@ class Autopilot {
|
|
|
44
54
|
}
|
|
45
55
|
});
|
|
46
56
|
}
|
|
47
|
-
start() {
|
|
57
|
+
async start() {
|
|
58
|
+
// Wait for all the streams and vad worker to be ready before proceeding starting the actor
|
|
59
|
+
await this.vadWorkerReady;
|
|
60
|
+
await this.setupVoiceStream();
|
|
61
|
+
await this.setupSpeechGathering();
|
|
48
62
|
this.actor.start();
|
|
49
63
|
this.actor.subscribe((state) => {
|
|
50
64
|
logger.verbose("actor's new state is", { state: state.value });
|
|
51
65
|
});
|
|
52
|
-
this.setupVoiceStream();
|
|
53
|
-
this.setupSpeechGathering();
|
|
54
66
|
this.vadWorker.on("error", (err) => {
|
|
55
67
|
logger.error("vad worker error", err);
|
|
56
68
|
});
|
package/dist/envs.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export declare const KNOWLEDGE_BASE_ENABLED: boolean;
|
|
|
6
6
|
export declare const NODE_ENV: string;
|
|
7
7
|
export declare const UNSTRUCTURED_API_KEY: string;
|
|
8
8
|
export declare const UNSTRUCTURED_API_URL: string;
|
|
9
|
-
export declare const SILERO_VAD_VERSION: string;
|
|
10
9
|
export declare const CONVERSATION_PROVIDER: string;
|
|
11
10
|
export declare const CONVERSATION_PROVIDER_FILE: string;
|
|
12
11
|
export declare const APISERVER_ENDPOINT: string;
|
package/dist/envs.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SKIP_IDENTITY = exports.OPENAI_API_KEY = exports.INTEGRATIONS_FILE = exports.APISERVER_ENDPOINT = exports.CONVERSATION_PROVIDER_FILE = exports.CONVERSATION_PROVIDER = exports.
|
|
6
|
+
exports.SKIP_IDENTITY = exports.OPENAI_API_KEY = exports.INTEGRATIONS_FILE = exports.APISERVER_ENDPOINT = exports.CONVERSATION_PROVIDER_FILE = exports.CONVERSATION_PROVIDER = exports.UNSTRUCTURED_API_URL = exports.UNSTRUCTURED_API_KEY = exports.NODE_ENV = exports.KNOWLEDGE_BASE_ENABLED = exports.AWS_S3_SECRET_ACCESS_KEY = exports.AWS_S3_REGION = exports.AWS_S3_ENDPOINT = exports.AWS_S3_ACCESS_KEY_ID = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
9
9
|
* http://github.com/fonoster/fonoster
|
|
@@ -39,7 +39,6 @@ exports.NODE_ENV = e.NODE_ENV || "production";
|
|
|
39
39
|
exports.UNSTRUCTURED_API_KEY = e.AUTOPILOT_UNSTRUCTURED_API_KEY ?? "";
|
|
40
40
|
exports.UNSTRUCTURED_API_URL = e.AUTOPILOT_UNSTRUCTURED_API_URL ??
|
|
41
41
|
"https://api.unstructuredapp.io/general/v0/general";
|
|
42
|
-
exports.SILERO_VAD_VERSION = e.AUTOPILOT_SILERO_VAD_VERSION ?? "v5";
|
|
43
42
|
exports.CONVERSATION_PROVIDER = e.AUTOPILOT_CONVERSATION_PROVIDER
|
|
44
43
|
? e.AUTOPILOT_CONVERSATION_PROVIDER
|
|
45
44
|
: types_1.ConversationProvider.FILE;
|
|
@@ -54,10 +53,6 @@ exports.INTEGRATIONS_FILE = e.AUTOPILOT_INTEGRATIONS_FILE
|
|
|
54
53
|
: "/opt/fonoster/integrations.json";
|
|
55
54
|
exports.OPENAI_API_KEY = e.AUTOPILOT_OPENAI_API_KEY;
|
|
56
55
|
exports.SKIP_IDENTITY = e.AUTOPILOT_SKIP_IDENTITY === "true";
|
|
57
|
-
if (exports.SILERO_VAD_VERSION !== "v4" && exports.SILERO_VAD_VERSION !== "v5") {
|
|
58
|
-
console.error("SILERO_VAD_VERSION must be set to 'v4' or 'v5'");
|
|
59
|
-
process.exit(1);
|
|
60
|
-
}
|
|
61
56
|
if (exports.CONVERSATION_PROVIDER.toLocaleLowerCase() !== types_1.ConversationProvider.API &&
|
|
62
57
|
exports.CONVERSATION_PROVIDER.toLocaleLowerCase() !== types_1.ConversationProvider.FILE) {
|
|
63
58
|
console.error("CONVERSATION_PROVIDER must be set to 'api' or 'file'");
|
|
@@ -116,7 +116,7 @@ async function handleVoiceRequest(req, res) {
|
|
|
116
116
|
voice: voice,
|
|
117
117
|
languageModel: languageModel
|
|
118
118
|
});
|
|
119
|
-
autopilot.start();
|
|
119
|
+
await autopilot.start();
|
|
120
120
|
res.on(common_1.StreamEvent.END, async () => {
|
|
121
121
|
autopilot.stop();
|
|
122
122
|
const rawChatHistory = await languageModel.getChatHistoryMessages();
|
package/dist/vad/SileroVad.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Vad } from "./types";
|
|
2
2
|
declare class SileroVad implements Vad {
|
|
3
3
|
private vad;
|
|
4
|
-
private params;
|
|
4
|
+
private readonly params;
|
|
5
5
|
constructor(params: {
|
|
6
|
-
pathToModel
|
|
6
|
+
pathToModel: string;
|
|
7
7
|
activationThreshold: number;
|
|
8
8
|
deactivationThreshold: number;
|
|
9
9
|
debounceFrames: number;
|
|
10
10
|
});
|
|
11
|
-
pathToModel
|
|
11
|
+
pathToModel: string;
|
|
12
12
|
activationThreshold: number;
|
|
13
13
|
deactivationThreshold: number;
|
|
14
14
|
debounceFrames: number;
|
package/dist/vad/SileroVad.js
CHANGED
|
@@ -24,7 +24,7 @@ const createVad_1 = require("./createVad");
|
|
|
24
24
|
const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
|
|
25
25
|
class SileroVad {
|
|
26
26
|
constructor(params) {
|
|
27
|
-
logger.verbose("starting instance of silero vad
|
|
27
|
+
logger.verbose("starting instance of silero vad v5", { ...params });
|
|
28
28
|
this.params = params;
|
|
29
29
|
}
|
|
30
30
|
async init() {
|
|
@@ -32,7 +32,7 @@ class SileroVad {
|
|
|
32
32
|
}
|
|
33
33
|
processChunk(data, callback) {
|
|
34
34
|
if (!this.vad) {
|
|
35
|
-
throw new Error("VAD not initialized
|
|
35
|
+
throw new Error("VAD not initialized");
|
|
36
36
|
}
|
|
37
37
|
this.vad(data, callback);
|
|
38
38
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { ONNXRuntimeAPI, SpeechProbabilities } from "./types";
|
|
2
2
|
declare class SileroVadModel {
|
|
3
|
-
private ort;
|
|
4
|
-
private pathToModel;
|
|
5
|
-
_session
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
_sr: unknown;
|
|
3
|
+
private readonly ort;
|
|
4
|
+
private readonly pathToModel;
|
|
5
|
+
private _session;
|
|
6
|
+
private _state;
|
|
7
|
+
private _sr;
|
|
9
8
|
constructor(ort: ONNXRuntimeAPI, pathToModel: string);
|
|
10
|
-
static new: (ort: ONNXRuntimeAPI, pathToModel: string) => Promise<SileroVadModel>;
|
|
9
|
+
static readonly new: (ort: ONNXRuntimeAPI, pathToModel: string) => Promise<SileroVadModel>;
|
|
11
10
|
init(): Promise<void>;
|
|
11
|
+
resetState: () => void;
|
|
12
12
|
process(audioFrame: Float32Array): Promise<SpeechProbabilities>;
|
|
13
|
-
resetState(): void;
|
|
14
13
|
}
|
|
15
14
|
export { SileroVadModel };
|
|
@@ -21,40 +21,58 @@ exports.SileroVadModel = void 0;
|
|
|
21
21
|
* limitations under the License.
|
|
22
22
|
*/
|
|
23
23
|
const fs_1 = require("fs");
|
|
24
|
+
const SAMPLE_RATE = 16000;
|
|
25
|
+
function getNewState(ortInstance) {
|
|
26
|
+
return new ortInstance.Tensor("float32", new Float32Array(2 * 1 * 128), // Use Float32Array for consistency
|
|
27
|
+
[2, 1, 128]);
|
|
28
|
+
}
|
|
24
29
|
class SileroVadModel {
|
|
25
30
|
constructor(ort, pathToModel) {
|
|
26
31
|
this.ort = ort;
|
|
27
32
|
this.pathToModel = pathToModel;
|
|
33
|
+
this.resetState = () => {
|
|
34
|
+
this._state = getNewState(this.ort);
|
|
35
|
+
};
|
|
28
36
|
}
|
|
29
37
|
async init() {
|
|
30
38
|
const modelArrayBuffer = (0, fs_1.readFileSync)(this.pathToModel).buffer;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
const sessionOption = {
|
|
40
|
+
interOpNumThreads: 1,
|
|
41
|
+
intraOpNumThreads: 1,
|
|
42
|
+
enableCpuMemArena: false
|
|
43
|
+
};
|
|
44
|
+
this._session = await this.ort.InferenceSession.create(modelArrayBuffer, sessionOption);
|
|
45
|
+
// Validate model inputs/outputs
|
|
46
|
+
const requiredInputs = ["input", "state", "sr"];
|
|
47
|
+
for (const name of requiredInputs) {
|
|
48
|
+
if (!this._session.inputNames.includes(name)) {
|
|
49
|
+
throw new Error(`Model is missing expected input "${name}"`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (!this._session.outputNames.includes("output") ||
|
|
53
|
+
!this._session.outputNames.includes("stateN")) {
|
|
54
|
+
throw new Error("Model is missing expected outputs");
|
|
55
|
+
}
|
|
56
|
+
// Use BigInt for sample rate tensor
|
|
57
|
+
this._sr = new this.ort.Tensor("int64", [BigInt(SAMPLE_RATE)], []);
|
|
58
|
+
this._state = getNewState(this.ort);
|
|
34
59
|
}
|
|
35
60
|
async process(audioFrame) {
|
|
36
|
-
const
|
|
61
|
+
const inputTensor = new this.ort.Tensor("float32", audioFrame, [
|
|
37
62
|
1,
|
|
38
63
|
audioFrame.length
|
|
39
64
|
]);
|
|
40
|
-
const
|
|
41
|
-
input:
|
|
42
|
-
|
|
43
|
-
c: this._c,
|
|
65
|
+
const feeds = {
|
|
66
|
+
input: inputTensor,
|
|
67
|
+
state: this._state,
|
|
44
68
|
sr: this._sr
|
|
45
69
|
};
|
|
46
|
-
const out = await this._session.run(
|
|
47
|
-
this.
|
|
48
|
-
this._c = out.cn;
|
|
70
|
+
const out = await this._session.run(feeds);
|
|
71
|
+
this._state = out.stateN;
|
|
49
72
|
const [isSpeech] = out.output.data;
|
|
50
73
|
const notSpeech = 1 - isSpeech;
|
|
51
74
|
return { notSpeech, isSpeech };
|
|
52
75
|
}
|
|
53
|
-
resetState() {
|
|
54
|
-
const zeroes = Array(2 * 64).fill(0);
|
|
55
|
-
this._h = new this.ort.Tensor("float32", zeroes, [2, 1, 64]);
|
|
56
|
-
this._c = new this.ort.Tensor("float32", zeroes, [2, 1, 64]);
|
|
57
|
-
}
|
|
58
76
|
}
|
|
59
77
|
exports.SileroVadModel = SileroVadModel;
|
|
60
78
|
_a = SileroVadModel;
|
package/dist/vad/createVad.d.ts
CHANGED
package/dist/vad/createVad.js
CHANGED
|
@@ -58,47 +58,61 @@ const ort = __importStar(require("onnxruntime-node"));
|
|
|
58
58
|
const chunkToFloat32Array_1 = require("./chunkToFloat32Array");
|
|
59
59
|
const SileroVadModel_1 = require("./SileroVadModel");
|
|
60
60
|
const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
|
|
61
|
-
const FULL_FRAME_SIZE =
|
|
62
|
-
const
|
|
61
|
+
const FULL_FRAME_SIZE = 1024; // 64ms @ 16kHz
|
|
62
|
+
const BUFFER_SIZE = 512; // 32ms @ 16kHz
|
|
63
63
|
async function createVad(params) {
|
|
64
64
|
const { pathToModel, activationThreshold, deactivationThreshold, debounceFrames } = params;
|
|
65
|
-
const effectivePath = pathToModel || (0, path_1.join)(__dirname, "..", "..", "
|
|
66
|
-
const
|
|
67
|
-
|
|
65
|
+
const effectivePath = pathToModel || (0, path_1.join)(__dirname, "..", "..", "silero_vad_v5.onnx");
|
|
66
|
+
const ortAdapter = {
|
|
67
|
+
InferenceSession: {
|
|
68
|
+
create: ort.InferenceSession.create.bind(ort.InferenceSession)
|
|
69
|
+
},
|
|
70
|
+
Tensor: ort.Tensor
|
|
71
|
+
};
|
|
72
|
+
const silero = await SileroVadModel_1.SileroVadModel.new(ortAdapter, effectivePath);
|
|
73
|
+
let sampleBuffer = [];
|
|
68
74
|
let isSpeechActive = false;
|
|
69
75
|
let framesSinceStateChange = 0;
|
|
76
|
+
// Reset internal state after a state change.
|
|
77
|
+
const resetState = () => {
|
|
78
|
+
isSpeechActive = false;
|
|
79
|
+
framesSinceStateChange = 0;
|
|
80
|
+
// Clear any pending audio samples to avoid using outdated values.
|
|
81
|
+
sampleBuffer = [];
|
|
82
|
+
silero.resetState();
|
|
83
|
+
logger.silly("State reset -- sampleBuffer cleared");
|
|
84
|
+
};
|
|
70
85
|
return async function process(chunk, callback) {
|
|
86
|
+
// Convert the incoming chunk to normalized Float32 samples (using chunkToFloat32Array)
|
|
71
87
|
const float32Array = (0, chunkToFloat32Array_1.chunkToFloat32Array)(chunk);
|
|
72
|
-
|
|
73
|
-
//
|
|
74
|
-
while (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const frame = fullFrame.slice(fullFrame.length - FRAME_SIZE);
|
|
88
|
+
sampleBuffer.push(...float32Array);
|
|
89
|
+
// Wait until we've collected a full frame worth of samples.
|
|
90
|
+
while (sampleBuffer.length >= FULL_FRAME_SIZE) {
|
|
91
|
+
const fullFrame = sampleBuffer.slice(0, FULL_FRAME_SIZE);
|
|
92
|
+
sampleBuffer = sampleBuffer.slice(FULL_FRAME_SIZE);
|
|
93
|
+
// Use the last BUFFER_SIZE samples from the full frame.
|
|
94
|
+
const frame = fullFrame.slice(fullFrame.length - BUFFER_SIZE);
|
|
80
95
|
const result = await silero.process(new Float32Array(frame));
|
|
81
96
|
const rawScore = result.isSpeech;
|
|
82
97
|
logger.silly("Frame processing", {
|
|
83
98
|
rawScore,
|
|
84
99
|
isSpeechActive,
|
|
85
100
|
framesSinceStateChange,
|
|
86
|
-
pendingSamples:
|
|
101
|
+
pendingSamples: sampleBuffer.length
|
|
87
102
|
});
|
|
88
103
|
framesSinceStateChange++;
|
|
89
104
|
if (isSpeechActive) {
|
|
90
|
-
// If
|
|
105
|
+
// If already in speech, check if the score has dropped below deactivationThreshold
|
|
91
106
|
if (rawScore < deactivationThreshold &&
|
|
92
107
|
framesSinceStateChange >= debounceFrames) {
|
|
93
|
-
isSpeechActive = false;
|
|
94
108
|
callback("SPEECH_END");
|
|
95
|
-
|
|
96
|
-
framesSinceStateChange = 0;
|
|
109
|
+
resetState();
|
|
97
110
|
logger.silly("Speech end detected", { rawScore });
|
|
111
|
+
continue;
|
|
98
112
|
}
|
|
99
113
|
}
|
|
100
114
|
else {
|
|
101
|
-
// If
|
|
115
|
+
// If currently not speaking, check if the score is above activationThreshold
|
|
102
116
|
if (rawScore > activationThreshold &&
|
|
103
117
|
framesSinceStateChange >= debounceFrames) {
|
|
104
118
|
isSpeechActive = true;
|
package/dist/vad/types.d.ts
CHANGED
|
@@ -26,19 +26,35 @@ type VadParams = {
|
|
|
26
26
|
deactivationThreshold: number;
|
|
27
27
|
debounceFrames: number;
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
export interface SpeechProbabilities {
|
|
30
30
|
notSpeech: number;
|
|
31
31
|
isSpeech: number;
|
|
32
|
-
}
|
|
33
|
-
|
|
32
|
+
}
|
|
33
|
+
export interface ONNXRuntimeAPI {
|
|
34
34
|
InferenceSession: {
|
|
35
|
-
create(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
new (type: "float32", data: Float32Array, dims: [1, number]): unknown;
|
|
41
|
-
new (type: "float32", data: Float32Array, dims: [1, number]): unknown;
|
|
35
|
+
create: (modelPath: ArrayBuffer | string, options?: {
|
|
36
|
+
interOpNumThreads: number;
|
|
37
|
+
intraOpNumThreads: number;
|
|
38
|
+
enableCpuMemArena: boolean;
|
|
39
|
+
}) => Promise<ONNXSession>;
|
|
42
40
|
};
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
Tensor: new (type: string, data: Float32Array | bigint[], dims: number[]) => ONNXTensor;
|
|
42
|
+
}
|
|
43
|
+
export interface ONNXSession {
|
|
44
|
+
run: (feeds: {
|
|
45
|
+
[key: string]: ONNXTensor;
|
|
46
|
+
}) => Promise<{
|
|
47
|
+
output: {
|
|
48
|
+
data: Float32Array;
|
|
49
|
+
};
|
|
50
|
+
stateN: ONNXTensor;
|
|
51
|
+
}>;
|
|
52
|
+
inputNames: string[];
|
|
53
|
+
outputNames: string[];
|
|
54
|
+
}
|
|
55
|
+
export interface ONNXTensor {
|
|
56
|
+
data: Float32Array | bigint[];
|
|
57
|
+
dims: number[];
|
|
58
|
+
type: string;
|
|
59
|
+
}
|
|
60
|
+
export { Vad, VadEvent, VadParams };
|
package/dist/vadWorker.js
CHANGED
|
@@ -20,19 +20,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
20
20
|
*/
|
|
21
21
|
const path_1 = require("path");
|
|
22
22
|
const worker_threads_1 = require("worker_threads");
|
|
23
|
-
const envs_1 = require("./envs");
|
|
24
23
|
const SileroVad_1 = require("./vad/SileroVad");
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
pathToModel: (0, path_1.join)(__dirname, "..", "silero_vad.onnx")
|
|
30
|
-
})
|
|
31
|
-
: new SileroVad_2.SileroVad({
|
|
32
|
-
...worker_threads_1.workerData,
|
|
33
|
-
pathToModel: (0, path_1.join)(__dirname, "..", "silero_vad_v5.onnx")
|
|
34
|
-
});
|
|
24
|
+
const vad = new SileroVad_1.SileroVad({
|
|
25
|
+
...worker_threads_1.workerData,
|
|
26
|
+
pathToModel: (0, path_1.join)(__dirname, "..", "silero_vad_v5.onnx")
|
|
27
|
+
});
|
|
35
28
|
vad.init().then(() => {
|
|
29
|
+
// Send ready message to parent
|
|
30
|
+
worker_threads_1.parentPort?.postMessage("VAD_READY");
|
|
36
31
|
worker_threads_1.parentPort?.on("message", (chunk) => {
|
|
37
32
|
vad.processChunk(chunk, (voiceActivity) => {
|
|
38
33
|
worker_threads_1.parentPort?.postMessage(voiceActivity);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/autopilot",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.40",
|
|
4
4
|
"description": "Voice AI for the Fonoster platform",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"js-yaml": "^4.1.0",
|
|
51
51
|
"langchain": "^0.3.6",
|
|
52
52
|
"moment": "^2.30.1",
|
|
53
|
-
"onnxruntime-node": "^1.
|
|
53
|
+
"onnxruntime-node": "^1.21.0",
|
|
54
54
|
"pdf-parse": "^1.1.1",
|
|
55
55
|
"uuid": "^11.0.3",
|
|
56
56
|
"xstate": "^5.17.3",
|
|
57
57
|
"zod": "^3.23.8"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "b5150ccfba8a96468d4e478796ac8e84fe57ff07"
|
|
60
60
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Vad } from "./types";
|
|
2
|
-
declare class SileroVad implements Vad {
|
|
3
|
-
private vad;
|
|
4
|
-
private readonly params;
|
|
5
|
-
constructor(params: {
|
|
6
|
-
pathToModel: string;
|
|
7
|
-
activationThreshold: number;
|
|
8
|
-
deactivationThreshold: number;
|
|
9
|
-
debounceFrames: number;
|
|
10
|
-
});
|
|
11
|
-
pathToModel: string;
|
|
12
|
-
activationThreshold: number;
|
|
13
|
-
deactivationThreshold: number;
|
|
14
|
-
debounceFrames: number;
|
|
15
|
-
init(): Promise<void>;
|
|
16
|
-
processChunk(data: Uint8Array, callback: (event: "SPEECH_START" | "SPEECH_END") => void): void;
|
|
17
|
-
}
|
|
18
|
-
export { SileroVad };
|
package/dist/vadv5/SileroVad.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SileroVad = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
6
|
-
* http://github.com/fonoster/fonoster
|
|
7
|
-
*
|
|
8
|
-
* This file is part of Fonoster
|
|
9
|
-
*
|
|
10
|
-
* Licensed under the MIT License (the "License");
|
|
11
|
-
* you may not use this file except in compliance with
|
|
12
|
-
* the License. You may obtain a copy of the License at
|
|
13
|
-
*
|
|
14
|
-
* https://opensource.org/licenses/MIT
|
|
15
|
-
*
|
|
16
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
-
* See the License for the specific language governing permissions and
|
|
20
|
-
* limitations under the License.
|
|
21
|
-
*/
|
|
22
|
-
const logger_1 = require("@fonoster/logger");
|
|
23
|
-
const createVad_1 = require("./createVad");
|
|
24
|
-
const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
|
|
25
|
-
class SileroVad {
|
|
26
|
-
constructor(params) {
|
|
27
|
-
logger.verbose("starting instance of silero vad v5", { ...params });
|
|
28
|
-
this.params = params;
|
|
29
|
-
}
|
|
30
|
-
async init() {
|
|
31
|
-
this.vad = await (0, createVad_1.createVad)(this.params);
|
|
32
|
-
}
|
|
33
|
-
processChunk(data, callback) {
|
|
34
|
-
if (!this.vad) {
|
|
35
|
-
throw new Error("VAD not initialized");
|
|
36
|
-
}
|
|
37
|
-
this.vad(data, callback);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.SileroVad = SileroVad;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ONNXRuntimeAPI, SpeechProbabilities } from "./types";
|
|
2
|
-
declare class SileroVadModel {
|
|
3
|
-
private readonly ort;
|
|
4
|
-
private readonly pathToModel;
|
|
5
|
-
private _session;
|
|
6
|
-
private _state;
|
|
7
|
-
private _sr;
|
|
8
|
-
constructor(ort: ONNXRuntimeAPI, pathToModel: string);
|
|
9
|
-
static readonly new: (ort: ONNXRuntimeAPI, pathToModel: string) => Promise<SileroVadModel>;
|
|
10
|
-
init(): Promise<void>;
|
|
11
|
-
resetState: () => void;
|
|
12
|
-
process(audioFrame: Float32Array): Promise<SpeechProbabilities>;
|
|
13
|
-
}
|
|
14
|
-
export { SileroVadModel };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.SileroVadModel = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
7
|
-
* http://github.com/fonoster/fonoster
|
|
8
|
-
*
|
|
9
|
-
* This file is part of Fonoster
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the MIT License (the "License");
|
|
12
|
-
* you may not use this file except in compliance with
|
|
13
|
-
* the License. You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* https://opensource.org/licenses/MIT
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License.
|
|
22
|
-
*/
|
|
23
|
-
const fs_1 = require("fs");
|
|
24
|
-
const SAMPLE_RATE = 16000;
|
|
25
|
-
function getNewState(ortInstance) {
|
|
26
|
-
return new ortInstance.Tensor("float32", new Float32Array(2 * 1 * 128), // Use Float32Array for consistency
|
|
27
|
-
[2, 1, 128]);
|
|
28
|
-
}
|
|
29
|
-
class SileroVadModel {
|
|
30
|
-
constructor(ort, pathToModel) {
|
|
31
|
-
this.ort = ort;
|
|
32
|
-
this.pathToModel = pathToModel;
|
|
33
|
-
this.resetState = () => {
|
|
34
|
-
this._state = getNewState(this.ort);
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
async init() {
|
|
38
|
-
const modelArrayBuffer = (0, fs_1.readFileSync)(this.pathToModel).buffer;
|
|
39
|
-
const sessionOption = { interOpNumThreads: 1, intraOpNumThreads: 1 };
|
|
40
|
-
this._session = await this.ort.InferenceSession.create(modelArrayBuffer, sessionOption);
|
|
41
|
-
// Validate model inputs/outputs
|
|
42
|
-
const requiredInputs = ["input", "state", "sr"];
|
|
43
|
-
for (const name of requiredInputs) {
|
|
44
|
-
if (!this._session.inputNames.includes(name)) {
|
|
45
|
-
throw new Error(`Model is missing expected input "${name}"`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
if (!this._session.outputNames.includes("output") ||
|
|
49
|
-
!this._session.outputNames.includes("stateN")) {
|
|
50
|
-
throw new Error("Model is missing expected outputs");
|
|
51
|
-
}
|
|
52
|
-
// Use BigInt for sample rate tensor
|
|
53
|
-
this._sr = new this.ort.Tensor("int64", [BigInt(SAMPLE_RATE)], []);
|
|
54
|
-
this._state = getNewState(this.ort);
|
|
55
|
-
}
|
|
56
|
-
async process(audioFrame) {
|
|
57
|
-
const inputTensor = new this.ort.Tensor("float32", audioFrame, [
|
|
58
|
-
1,
|
|
59
|
-
audioFrame.length
|
|
60
|
-
]);
|
|
61
|
-
const feeds = {
|
|
62
|
-
input: inputTensor,
|
|
63
|
-
state: this._state,
|
|
64
|
-
sr: this._sr
|
|
65
|
-
};
|
|
66
|
-
const out = await this._session.run(feeds);
|
|
67
|
-
this._state = out.stateN;
|
|
68
|
-
const [isSpeech] = out.output.data;
|
|
69
|
-
const notSpeech = 1 - isSpeech;
|
|
70
|
-
return { notSpeech, isSpeech };
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exports.SileroVadModel = SileroVadModel;
|
|
74
|
-
_a = SileroVadModel;
|
|
75
|
-
SileroVadModel.new = async (ort, pathToModel) => {
|
|
76
|
-
const model = new _a(ort, pathToModel);
|
|
77
|
-
await model.init();
|
|
78
|
-
return model;
|
|
79
|
-
};
|
package/dist/vadv5/createVad.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.createVad = createVad;
|
|
37
|
-
/**
|
|
38
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
39
|
-
* http://github.com/fonoster/fonoster
|
|
40
|
-
*
|
|
41
|
-
* This file is part of Fonoster
|
|
42
|
-
*
|
|
43
|
-
* Licensed under the MIT License (the "License");
|
|
44
|
-
* you may not use this file except in compliance with
|
|
45
|
-
* the License. You may obtain a copy of the License at
|
|
46
|
-
*
|
|
47
|
-
* https://opensource.org/licenses/MIT
|
|
48
|
-
*
|
|
49
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
50
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
51
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
52
|
-
* See the License for the specific language governing permissions and
|
|
53
|
-
* limitations under the License.
|
|
54
|
-
*/
|
|
55
|
-
const path_1 = require("path");
|
|
56
|
-
const logger_1 = require("@fonoster/logger");
|
|
57
|
-
const ort = __importStar(require("onnxruntime-node"));
|
|
58
|
-
const chunkToFloat32Array_1 = require("../vad/chunkToFloat32Array");
|
|
59
|
-
const SileroVadModel_1 = require("./SileroVadModel");
|
|
60
|
-
const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
|
|
61
|
-
const FULL_FRAME_SIZE = 1024; // 64ms @ 16kHz
|
|
62
|
-
const BUFFER_SIZE = 512; // 32ms @ 16kHz
|
|
63
|
-
async function createVad(params) {
|
|
64
|
-
const { pathToModel, activationThreshold, deactivationThreshold, debounceFrames } = params;
|
|
65
|
-
const effectivePath = pathToModel || (0, path_1.join)(__dirname, "..", "..", "silero_vad_v5.onnx");
|
|
66
|
-
const silero = await SileroVadModel_1.SileroVadModel.new(ort, effectivePath);
|
|
67
|
-
let sampleBuffer = [];
|
|
68
|
-
let isSpeechActive = false;
|
|
69
|
-
let framesSinceStateChange = 0;
|
|
70
|
-
// Reset internal state after a state change.
|
|
71
|
-
const resetState = () => {
|
|
72
|
-
isSpeechActive = false;
|
|
73
|
-
framesSinceStateChange = 0;
|
|
74
|
-
// Clear any pending audio samples to avoid using outdated values.
|
|
75
|
-
sampleBuffer = [];
|
|
76
|
-
silero.resetState();
|
|
77
|
-
logger.silly("State reset -- sampleBuffer cleared");
|
|
78
|
-
};
|
|
79
|
-
return async function process(chunk, callback) {
|
|
80
|
-
// Convert the incoming chunk to normalized Float32 samples (using chunkToFloat32Array)
|
|
81
|
-
const float32Array = (0, chunkToFloat32Array_1.chunkToFloat32Array)(chunk);
|
|
82
|
-
sampleBuffer.push(...float32Array);
|
|
83
|
-
// Wait until we've collected a full frame worth of samples.
|
|
84
|
-
while (sampleBuffer.length >= FULL_FRAME_SIZE) {
|
|
85
|
-
const fullFrame = sampleBuffer.slice(0, FULL_FRAME_SIZE);
|
|
86
|
-
sampleBuffer = sampleBuffer.slice(FULL_FRAME_SIZE);
|
|
87
|
-
// Use the last BUFFER_SIZE samples from the full frame.
|
|
88
|
-
const frame = fullFrame.slice(fullFrame.length - BUFFER_SIZE);
|
|
89
|
-
const result = await silero.process(new Float32Array(frame));
|
|
90
|
-
const rawScore = result.isSpeech;
|
|
91
|
-
logger.silly("Frame processing", {
|
|
92
|
-
rawScore,
|
|
93
|
-
isSpeechActive,
|
|
94
|
-
framesSinceStateChange,
|
|
95
|
-
pendingSamples: sampleBuffer.length
|
|
96
|
-
});
|
|
97
|
-
framesSinceStateChange++;
|
|
98
|
-
if (isSpeechActive) {
|
|
99
|
-
// If already in speech, check if the score has dropped below deactivationThreshold
|
|
100
|
-
if (rawScore < deactivationThreshold &&
|
|
101
|
-
framesSinceStateChange >= debounceFrames) {
|
|
102
|
-
callback("SPEECH_END");
|
|
103
|
-
resetState();
|
|
104
|
-
logger.silly("Speech end detected", { rawScore });
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
// If currently not speaking, check if the score is above activationThreshold
|
|
110
|
-
if (rawScore > activationThreshold &&
|
|
111
|
-
framesSinceStateChange >= debounceFrames) {
|
|
112
|
-
isSpeechActive = true;
|
|
113
|
-
framesSinceStateChange = 0;
|
|
114
|
-
callback("SPEECH_START");
|
|
115
|
-
logger.silly("Speech start detected", { rawScore });
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
}
|
package/dist/vadv5/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
export * from "./SileroVad";
|
|
20
|
-
export * from "./types";
|
package/dist/vadv5/index.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
/**
|
|
18
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
19
|
-
* http://github.com/fonoster/fonoster
|
|
20
|
-
*
|
|
21
|
-
* This file is part of Fonoster
|
|
22
|
-
*
|
|
23
|
-
* Licensed under the MIT License (the "License");
|
|
24
|
-
* you may not use this file except in compliance with
|
|
25
|
-
* the License. You may obtain a copy of the License at
|
|
26
|
-
*
|
|
27
|
-
* https://opensource.org/licenses/MIT
|
|
28
|
-
*
|
|
29
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
30
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
31
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
32
|
-
* See the License for the specific language governing permissions and
|
|
33
|
-
* limitations under the License.
|
|
34
|
-
*/
|
|
35
|
-
__exportStar(require("./SileroVad"), exports);
|
|
36
|
-
__exportStar(require("./types"), exports);
|
package/dist/vadv5/types.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
type VadEvent = "SPEECH_START" | "SPEECH_END";
|
|
20
|
-
type Vad = {
|
|
21
|
-
processChunk: (chunk: Uint8Array, callback: (event: VadEvent) => void) => void;
|
|
22
|
-
};
|
|
23
|
-
export interface SpeechProbabilities {
|
|
24
|
-
notSpeech: number;
|
|
25
|
-
isSpeech: number;
|
|
26
|
-
}
|
|
27
|
-
export interface ONNXRuntimeAPI {
|
|
28
|
-
InferenceSession: {
|
|
29
|
-
create: (modelPath: ArrayBuffer | string, options?: {
|
|
30
|
-
interOpNumThreads: number;
|
|
31
|
-
intraOpNumThreads: number;
|
|
32
|
-
}) => Promise<ONNXSession>;
|
|
33
|
-
};
|
|
34
|
-
Tensor: new (type: string, data: Float32Array | bigint[], dims: number[]) => ONNXTensor;
|
|
35
|
-
}
|
|
36
|
-
export interface ONNXSession {
|
|
37
|
-
run: (feeds: {
|
|
38
|
-
[key: string]: ONNXTensor;
|
|
39
|
-
}) => Promise<{
|
|
40
|
-
output: {
|
|
41
|
-
data: Float32Array;
|
|
42
|
-
};
|
|
43
|
-
stateN: ONNXTensor;
|
|
44
|
-
}>;
|
|
45
|
-
inputNames: string[];
|
|
46
|
-
outputNames: string[];
|
|
47
|
-
}
|
|
48
|
-
export interface ONNXTensor {
|
|
49
|
-
data: Float32Array | bigint[];
|
|
50
|
-
dims: number[];
|
|
51
|
-
type: string;
|
|
52
|
-
}
|
|
53
|
-
export { Vad, VadEvent };
|
package/dist/vadv5/types.js
DELETED
package/silero_vad.onnx
DELETED
|
Binary file
|