import { VADAdapter, VADConfig, VADState, VADFactory, VADMetadata, VADEventEmitter } from '../'; /** * Smart Turn V3.2 Adapter Configuration */ export interface SmartTurnConfig extends VADConfig { /** Model URL override (defaults to CDN) */ modelUrl?: string; /** Preferred backend ('webgpu', 'wasm', 'auto') */ backend?: 'webgpu' | 'wasm' | 'auto'; /** Maximum audio buffer duration in seconds (default: 8) */ maxBufferDuration?: number; /** Run inference only when primary VAD detects silence (recommended) */ useWithPrimaryVAD?: boolean; /** Primary VAD adapter ID (e.g., 'silero', 'simple') */ primaryVADAdapter?: string; /** Confidence threshold for turn completion (0-1, default: 0.5) */ completionThreshold?: number; } /** * Smart Turn VAD Adapter * * Implements semantic turn detection using PipeCat's Smart Turn v3.2 model. * Supports WebGPU acceleration with WASM fallback. */ export declare class SmartTurnAdapter extends VADEventEmitter implements VADAdapter { readonly id = "smart-turn"; readonly name = "Smart Turn V3.2"; readonly version = "3.2.0"; private config; private state; private initialized; private backend; private session; private audioBuffer; private lastInferenceTime; private inferenceInterval; private inferenceInProgress; private speechStartTime; private static readonly MODEL_URL; constructor(config?: Partial); /** * Initialize the Smart Turn adapter */ initialize(): Promise; /** * Initialize WebGPU or WASM backend */ private initializeBackend; /** * Check if WebGPU is supported */ private isWebGPUSupported; /** * Configure ONNX Runtime to load all WASM assets from CDN * This must be called before creating any inference sessions */ private configureONNXRuntimeCDN; /** * Load ONNX Runtime from CDN or local import * Prefers CDN to avoid bundling the 64MB library */ private loadONNXRuntime; /** * Load ONNX Runtime from CDN (unpkg) */ private loadONNXRuntimeFromCDN; /** * Load ONNX model using onnxruntime-web */ private loadModel; /** * Process audio frame * * Strategy: * 1. Accumulate audio in buffer (max 8 seconds) * 2. Run inference periodically (every 500ms) * 3. Return probability of turn completion */ processFrame(frame: Float32Array, _timestamp: number): number | null; /** * Accumulate audio in buffer */ private accumulateAudio; /** * Run Smart Turn inference asynchronously */ private runInferenceAsync; configure(config: VADConfig): void; reset(): void; dispose(): void; isReady(): boolean; getState(): VADState; /** * Get current backend */ getBackend(): 'webgpu' | 'wasm' | null; } /** * Smart Turn Factory */ export declare class SmartTurnFactory implements VADFactory { create(config?: Partial): SmartTurnAdapter; getMetadata(): VADMetadata; } /** * Register Smart Turn adapter with VAD Registry * * This function ensures the SmartTurnAdapter 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 registerSmartTurnAdapter(): void; //# sourceMappingURL=SmartTurnAdapter.d.ts.map