import { VADAdapter, VADConfig, VADState, VADFactory, VADMetadata, VADEventEmitter } from '../'; /** * Silero VAD Adapter Configuration */ export interface SileroVADConfig extends VADConfig { /** Positive speech threshold (0-1, default: 0.35) - Lower = more sensitive */ positiveSpeechThreshold?: number; /** Negative speech threshold (0-1, default: 0.25) - Lower = keeps speech active longer */ negativeSpeechThreshold?: number; /** Pre-speech padding in milliseconds (default: 1500ms = 1.5 seconds) * This captures audio before speech is detected to avoid cutting off the beginning of speech. * According to MicVAD API docs: https://docs.vad.ricky0123.com/user-guide/api/ */ preSpeechPadMs?: number; /** Minimum speech duration in milliseconds (default: 400ms) * Speech segments shorter than this will trigger onVADMisfire instead of onSpeechEnd */ minSpeechMs?: number; /** Redemption duration in milliseconds (default: 1400ms) * Duration of silence before speech is considered ended */ redemptionMs?: number; } /** * Silero VAD Adapter * * Wraps @ricky0123/vad-web for voice activity detection. * This adapter emits events from MicVAD callbacks, allowing MicVAD to work * independently as intended without requiring frame-by-frame state checking. */ export declare class SileroVADAdapter extends VADEventEmitter implements VADAdapter { readonly id = "silero-vad"; readonly name = "Silero VAD"; readonly version = "5.0.0"; private config; private state; private initialized; private vad; private isSpeakingFlag; private mediaStream; private speechStartTime; constructor(config?: Partial); /** * Initialize the Silero VAD adapter * * Note: For MicVAD to work correctly with V5 model, it needs access to the MediaStream. * If stream is not provided, MicVAD will create its own stream (may cause duplicate mic access). * Call setMediaStream() after initialization if stream becomes available later. */ initialize(): Promise; /** * Set MediaStream for MicVAD * * CRITICAL for V5 model: MicVAD needs the MediaStream to process audio correctly. * This should be called before initialize() if possible, or MicVAD will create its own stream. * * @param stream - MediaStream from microphone */ setMediaStream(stream: MediaStream): void; /** * Process audio frame * * Note: @ricky0123/vad-web handles audio processing internally via MicVAD. * This method is called for compatibility but the actual processing happens * in the MicVAD worklet. MicVAD emits events via callbacks, which we forward * as adapter events. * * For adapters that handle audio internally (like MicVAD), this method may * be a no-op. The manager should listen to events instead of checking state. */ processFrame(_frame: Float32Array, _timestamp: number): number | null; configure(config: VADConfig): void; reset(): void; dispose(): void; isReady(): boolean; getState(): VADState; /** * Check if currently speaking */ isSpeaking(): boolean; /** * Start VAD processing */ start(): void; /** * Pause VAD processing */ pause(): void; /** * Resume VAD processing */ resume(): void; } /** * Silero VAD Factory */ export declare class SileroVADFactory implements VADFactory { create(config?: Partial): SileroVADAdapter; getMetadata(): VADMetadata; } /** * Register Silero VAD adapter with VAD Registry * * This function ensures the SileroVADAdapter is registered. * The adapter auto-registers when the module is imported, but this function * can be called explicitly to ensure registration. * * @returns void */ export declare function registerSileroVADAdapter(): void; //# sourceMappingURL=SileroVADAdapter.d.ts.map