UNPKG

hama-js

Version:

G2P, phoneme-ASR, and P2G inference for Node, Bun, and browsers, powered by a self-contained WASM engine (no onnxruntime).

19 lines (18 loc) 704 B
export declare const ASR_OUTPUT_FRAME_SAMPLES = 320; export interface PhonemeSpan { phoneme: string; startMs: number; endMs: number; startFrame: number; endFrame: number; } export interface CTCSpanOptions { blankId: number; wordBoundaryToken: string; frameMs: number; collapseRepeats?: boolean; } /** One PhonemeSpan per emitted phoneme (same emissions as decodeCtcTokens, `<wb>` * excluded), tiling the output-frame timeline: a phoneme runs from the frame it is * emitted until the next emission (or the end). */ export declare const ctcPhonemeSpans: (frameTokenIds: readonly number[], decoderTokens: readonly string[], options: CTCSpanOptions) => PhonemeSpan[];