diff --git a/.changeset/mighty-dogs-pull.md b/.changeset/mighty-dogs-pull.md new file mode 100644 index 00000000..58fb44e7 --- /dev/null +++ b/.changeset/mighty-dogs-pull.md @@ -0,0 +1,5 @@ +--- +"@livekit/agents-plugin-silero": patch +--- + +Windows compat: correct file load diff --git a/plugins/silero/src/onnx_model.ts b/plugins/silero/src/onnx_model.ts index d03211bb..e2fea330 100644 --- a/plugins/silero/src/onnx_model.ts +++ b/plugins/silero/src/onnx_model.ts @@ -1,12 +1,13 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc. // // SPDX-License-Identifier: Apache-2.0 +import { fileURLToPath } from 'node:url'; import { InferenceSession, Tensor } from 'onnxruntime-node'; export type SampleRate = 8000 | 16000; export const newInferenceSession = (forceCPU: boolean) => { - return InferenceSession.create(new URL('silero_vad.onnx', import.meta.url).pathname, { + return InferenceSession.create(fileURLToPath(new URL('silero_vad.onnx', import.meta.url).href), { interOpNumThreads: 1, intraOpNumThreads: 1, executionMode: 'sequential',