import { DEFAULT_SESSION_OPTIONS, type OrtRuntime } from "./ort-runtime.js"; export interface EmbeddingRequest { /** Caller-defined id. Echoed back in the result map. */ id: number; /** Row-major fbank (numFrames, 80). */ fbank: Float64Array | Float32Array; numFrames: number; } /** * WeSpeaker ResNet34 backbone wrapper. * * Input: Kaldi fbank features (numFrames, 80) — already mean-normalized. * Output: 256-d speaker embedding. */ export declare class EmbeddingModel { private readonly session; private readonly ort; private constructor(); static load(modelSource: string | ArrayBufferLike | Uint8Array, ort: OrtRuntime, sessionOptions?: typeof DEFAULT_SESSION_OPTIONS): Promise; /** Single-input inference. Convenience wrapper around `embedBatch`. */ embed(fbank: Float64Array | Float32Array, numFrames: number, numBins?: number): Promise; /** * Batched inference over heterogeneous-length inputs. * * Strategy: sort by descending length, slice into batches of `batchSize`, * pad each batch's inputs (zero-pad on the right) to the batch's max length. * Padding biases the WeSpeaker statistics pooling slightly, but bucketing * by length keeps the bias localized; the cost is small (< 0.1% DER drift * observed in practice). */ embedBatch(requests: EmbeddingRequest[], options?: { batchSize?: number; numBins?: number; onProgress?: (processed: number, total: number) => void; /** Sleep N ms between consecutive batches. Throttle for cooler CPU/GPU. */ batchYieldMs?: number; }): Promise>; } export declare function cosineSimilarity(a: Float32Array | number[], b: Float32Array | number[]): number; //# sourceMappingURL=embedding.d.ts.map