Reference v0.1.2
voxxy/stt/moonshine
Moonshine tiny speech recognition, running in its own worker. English.
import { … } from "voxxy/stt/moonshine"
Functions
moonshineFiles function
function moonshineFiles(
__namedParameters?: Pick<MoonshineOptions, "variant" | "baseUrl" | "wasmBaseUrl">
): { files: ModelFile[]; urls: MoonshineAdapterOptions }The files this provider needs, as the model manager will download and check them.
moonshineStt function
function moonshineStt(__namedParameters: MoonshineOptions): SttProviderSpeech-to-text with Moonshine tiny (English, MIT), running on onnxruntime-web in its own worker, one thread: no COOP/COEP needed. First use downloads the model (about 35 MB with the default compact, tokenizer included) and the runtime's wasm (14.8 MB, 3.8 MB gzipped on the wire), after the user's opt-in through voxxy.models.
Interfaces
MoonshineOptions interface
interface MoonshineOptionsOptions for moonshineStt(). Only recorder is required.
recorder: RecorderCaptures mono 16 kHz audio: createMicRecorder() in a page.
variant?: "compact" | "q4"Default "compact" (31 MB of model files); "q4" is 55 MB.
baseUrl?: stringServe the model files yourself: the folder that holds onnx/ and tokenizer.json. Default: Hugging Face, pinned to a commit.
wasmBaseUrl?: stringServe the onnxruntime-web wasm file yourself: the folder that holds ort-wasm-simd-threaded.wasm. Default: jsDelivr, pinned to the version.
workerUrl?: string | URLThe URL of the worker script, for bundlers that cannot find it on their own. Default: the one shipped next to this module.