import type { WakeInferenceSession, WakeTensor } from './types.js'; /** Samples per detector frame: 80 ms at 16 kHz. */ export declare const WAKE_CHUNK_SAMPLES = 1280; /** Milliseconds of audio per detector frame. */ export declare const WAKE_CHUNK_MS: number; /** Mel frames the embedding backbone consumes per inference. */ export declare const WAKE_EMBED_WINDOW_FRAMES = 76; /** Dimensions the embedding backbone emits per inference. */ export declare const WAKE_EMBED_DIM = 96; /** Embedding frames the classifier consumes. */ export declare const WAKE_CLASSIFIER_FRAMES = 16; /** * Extra trailing samples handed to the front end with each chunk, so framing * yields exactly `chunk / hop` new mel frames. Three hops. */ export declare const WAKE_MEL_CONTEXT_SAMPLES: number; /** How much raw audio the pipeline keeps for pre-roll, in seconds. */ export declare const WAKE_RAW_TAIL_SECONDS = 4; export interface FeaturePipelineOptions { /** The speech-embedding backbone session. */ readonly embedding: WakeInferenceSession; /** Chunk size in samples. Must be a whole number of 160-sample hops. */ readonly chunkSamples?: number | undefined; } /** * Streaming front end. One instance per audio stream; not safe to share across * concurrent streams because every buffer in it is stateful. */ export declare class WakeFeaturePipeline { #private; constructor(options: FeaturePipelineOptions); /** Samples this pipeline expects per {@link pushChunk} call. */ get chunkSamples(): number; /** True once enough frames have accumulated to produce classifier features. */ get ready(): boolean; /** * Return to the cold-start state: mel buffer primed with ones, no features, * no raw tail. Called on construction and whenever a stream restarts, so a * restarted detector cannot inherit half a phrase from before the crash. */ reset(): void; /** * Feed exactly {@link chunkSamples} samples of 16 kHz mono audio, as raw int16 * magnitudes expressed as floats (NOT normalised to [-1, 1], see * melspectrogram.ts). * * Returns the trailing 16 x 96 feature window as a flat tensor, or null while * the pipeline is still filling. Callers must not retain the returned tensor's * data across calls; it is reused. */ pushChunk(samples: Float32Array): Promise; /** * The most recent `ms` milliseconds of raw audio, for a detection's pre-roll. * Returns whatever is available when less has been seen, never pads. */ recentAudio(ms: number): Float32Array; } //# sourceMappingURL=feature-pipeline.d.ts.map