|
6 | 6 | VADEventType, |
7 | 7 | VADStream as baseStream, |
8 | 8 | VAD as baseVAD, |
9 | | - inference, |
10 | 9 | log, |
11 | 10 | mergeFrames, |
12 | 11 | } from '@livekit/agents'; |
@@ -100,31 +99,6 @@ export class VAD extends baseVAD { |
100 | 99 | */ |
101 | 100 | static async load(opts: Partial<VADOptions> = {}): Promise<baseVAD> { |
102 | 101 | const mergedOpts: VADOptions = { ...defaultVADOptions, ...opts }; |
103 | | - |
104 | | - // When the requested settings are compatible with the bundled native |
105 | | - // implementation in `@livekit/local-inference`, delegate to |
106 | | - // `inference.VAD({ model: 'silero' })` so existing call sites transparently |
107 | | - // get the faster, COW-shared native path as part of the silero deprecation. |
108 | | - // The native lib only ships the 16 kHz model, so any other sample rate |
109 | | - // falls back to the legacy onnxruntime path below. |
110 | | - if (mergedOpts.sampleRate === 16000) { |
111 | | - if (!mergedOpts.forceCPU) { |
112 | | - log().warn( |
113 | | - 'forceCPU=false is ignored when using the bundled native VAD; the ' + |
114 | | - 'model runs CPU-only. Use a non-16kHz sampleRate to keep the legacy ' + |
115 | | - 'onnxruntime path that honors forceCPU.', |
116 | | - ); |
117 | | - } |
118 | | - return new inference.VAD({ |
119 | | - model: 'silero', |
120 | | - minSpeechDuration: mergedOpts.minSpeechDuration, |
121 | | - minSilenceDuration: mergedOpts.minSilenceDuration, |
122 | | - prefixPaddingDuration: mergedOpts.prefixPaddingDuration, |
123 | | - maxBufferedSpeech: mergedOpts.maxBufferedSpeech, |
124 | | - activationThreshold: mergedOpts.activationThreshold, |
125 | | - }); |
126 | | - } |
127 | | - |
128 | 102 | const session = await newInferenceSession(mergedOpts.forceCPU); |
129 | 103 | return new VAD(session, mergedOpts); |
130 | 104 | } |
|
0 commit comments