@guidekit/vad
v0.1.1
Published
Silero VAD model for GuideKit SDK — voice activity detection via ONNX Runtime
Downloads
439
Maintainers
Readme
@guidekit/vad
Voice Activity Detection package for the GuideKit SDK. Wraps the Silero VAD ONNX model to detect when a user is speaking, enabling half-duplex voice interactions with barge-in detection.
Installation
npm install @guidekit/vadThis package is an optional peer dependency of @guidekit/core. It is automatically used when voice mode is enabled.
How It Works
@guidekit/vad loads the Silero VAD model via ONNX Runtime Web and runs inference on audio frames from the microphone. It emits speech_start and speech_end events that the core engine uses to trigger STT and manage barge-in.
Usage with GuideKit
When using @guidekit/react or @guidekit/vanilla, simply install this package and enable voice mode:
<GuideKitProvider
tokenEndpoint="/api/guidekit/token"
agent={{ name: 'Guide' }}
options={{ mode: 'voice' }}
>
{children}
</GuideKitProvider>The SDK detects the package automatically. If it is not installed and voice mode is requested, the SDK emits a VAD_PACKAGE_MISSING error and falls back to text-only mode.
Standalone Usage
import { createVAD } from '@guidekit/vad';
const vad = await createVAD({
onSpeechStart: () => console.log('Speaking...'),
onSpeechEnd: (audio) => console.log('Done, audio length:', audio.length),
});
// Start processing audio from a MediaStream
await vad.start(mediaStream);
// Stop
vad.destroy();Documentation
- Full documentation: guidekit-docs.vercel.app/docs/voice
- Main README
