Whistle API
    Preparing search index...

    Interface Whistle

    A ready, isolated speech engine with a FIFO inference queue.

    Each factory call owns its model and worker. Keep an instance for repeated clips and always dispose it when finished. Continuous transcription is not supported.

    interface Whistle {
        dispose(): Promise<void>;
        transcribe(
            audio: Float32Array,
            options?: TranscribeOptions,
        ): Promise<WhistleTranscript>;
    }
    Index
    • Permanently close the instance and release its worker/model resources.

      Returns Promise<void>

      The same completion promise on repeated calls; Node worker exit is awaited.

      All active and queued work rejects with DISPOSED. Later calls to transcribe also reject; disposing does not clear persistent browser assets.

    • Transcribe one completed clip of 16 kHz mono PCM.

      Parameters

      • audio: Float32Array

        1–480,000 finite samples in [-1, 1] (at most 30 seconds). Nonzero view offsets are respected. Samples are copied immediately, so the caller retains its attached buffer and may mutate it after invocation.

      • Optionaloptions: TranscribeOptions

        Per-request hints, timestamps and cancellation.

      Returns Promise<WhistleTranscript>

      A normalized transcript after earlier surviving requests complete.

      WhistleError for invalid PCM/options, cancellation, disposal, worker failure, allocation failure or invalid engine output.

      Invalid input is rejected, never silently chunked or truncated. Queued aborts remove only that request. Active aborts terminate the blocking WASM worker; surviving queued requests wait for a fresh local/model load. Failed inference is not retried. The PCM sample rate is the caller's responsibility.