automatic-speech-recognition · 27.1M params · variable-length RoPE · WASM q8 · 28.18 MB · MIT

Moonshine Tiny ASR: 28.18 MB Variable-Length Speech Recognition

Useful Sensors' Moonshine Tiny (UsefulSensors/moonshine-tiny, 27.1M parameters, MIT) transcribes English speech up to ~31× faster than real time on CPU WebAssembly. Unlike Whisper, its rotary-embedding encoder never zero-pads short clips to 30 seconds — compute scales linearly O(T) with the real audio length.

At a glance

Moonshine Tiny model specifications and browser runtime contract
Upstream model UsefulSensors/moonshine-tiny (MIT · 27.1M params · 6 encoder / 6 decoder layers, hidden 288, 8 heads, partial RoPE 0.9, 32,768 vocab)
ONNX artifact onnx-community/moonshine-tiny-ONNX (q8 · 28.18 MB = 28,180,947 B: encoder_model_quantized.onnx 7.94 MB + decoder_model_merged_quantized.onnx 20.24 MB)
Task & runtime automatic-speech-recognition · shared @huggingface/transformers@3.7.5 via lib/webai.js · CPU wasm
Input & decoder 16 kHz mono Float32Array PCM (direct 8/16/24/32-bit PCM & 32-bit float WAV + browser AudioContext fallback) · variable-length audio

1 · Transcribe audio or live microphone

Bundled audio: JFK inaugural excerpt (20 Jan 1961, public domain U.S. government work) and LibriSpeech test-clean 61-70968-0000 (Paul-Gabriel Wiener; Panayotov et al., OpenSLR SLR12, CC BY 4.0) · audio credits.

Initialise Moonshine Tiny (28.18 MB q8 WASM) above to transcribe locally.

Loading sample…

Live transcript

Run transcription above to see live text from Moonshine Tiny.
Inference time–
Audio length–
Speed vs real time–
Real-time factor–
Words / tokens–
Runtime · NaN check–

2 · See inside: Variable-length RoPE vs 30s padding

Whisper architectures zero-pad every clip to a 30.0 s mel window (480,000 samples). Moonshine Tiny feeds only the actual clip samples into its rotary-position encoder, eliminating wasted padding compute on short commands.

Actual samples @ 16 kHz–
Whisper 30s window480,000 (30.0 s)
Padding avoided–
Audio RMS / Peak–

3 · Use-case ladder

4 · Inspect worker, WAV decoder & mic code

Show the code · worker.js — ensureLoaded() (epoch-guarded Transformers.js 3.7.5 q8 pipeline)
Show the code · moonshine-tiny-core.mjs — parseWavToMono16k() (8/16/24/32-bit PCM & 32-bit float)
Show the code · moonshine-tiny.js — createMicRecorder() (track cleanup & 0-chunk safety)