LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

moonshine-voice

On-device speech recognition, intent matching, and text-to-speech

TLDR

Install the Python package (adds the CLI)
$ pip install moonshine-voice
copy
Transcribe live microphone input to the terminal
$ moonshine-voice mic --language [en]
copy
Transcribe a WAV file (optional speaker IDs and word timestamps)
$ moonshine-voice transcribe --wav-path [audio.wav] --speaker-ids --word-timestamps
copy
Synthesize speech and play it (or write a WAV)
$ moonshine-voice tts --language [en_us] --text ["Hello world"]
copy
Clone a voice from a short reference clip, then speak text
$ moonshine-voice tts --clone [reference.wav] --text ["This is my cloned voice"]
copy
Recognize spoken intents from the microphone
$ moonshine-voice intent --intents ["turn on the lights,turn off the lights,what is the weather"]
copy
Download model assets (STT, TTS, G2P, or intent)
$ moonshine-voice download --stt --language [en]
copy
Convert text to IPA phonemes with the built-in G2P engine
$ moonshine-voice g2p --language [en_us] --text ["Hello world"]
copy

SYNOPSIS

moonshine-voice command [options]moonshine-voice {mic | transcribe | tts | intent | download | g2p} [options]

DESCRIPTION

moonshine-voice is the command-line front end for Moonshine Voice, an open-source on-device toolkit for live speech interfaces. The same package ships a Python library and a portable C++ core; installing via pip registers moonshine-voice (and a shorter moonshine alias) as a thin dispatcher over the built-in demo modules.All processing can run fully offline after models are cached. Streaming STT models use flexible input windows and incremental caching so partial transcripts update while the user is still talking, targeting lower latency than fixed 30-second Whisper-style windows for live mic use. The stack also covers semantic intent matching, multi-engine TTS (Kokoro, Piper, and ZipVoice with optional voice cloning), and a MIT-licensed grapheme-to-phoneme (G2P) path used by synthesis.STT languages include English, Spanish, Mandarin, Japanese, Korean, Vietnamese, Ukrainian, and Arabic (language-specific models). TTS covers a wider set of locales via Kokoro/Piper/ZipVoice voice packs. The project also publishes microcontroller-oriented Moonshine Micro builds (VAD/STT/TTS under ~500 KiB RAM) separate from this CLI.

PARAMETERS

Common top-level options:-h, --help

Show usage and the list of subcommands.
-V, --version
Print the installed moonshine-voice package version.
Subcommand flags (most used):mic / intent: --language code (default en), --model-arch ntranscribe: --wav-path file, --language code, --model-path dir, --speaker-ids, --word-timestamps, --quiet, --options key=value,...tts: --language tag (default en_us), --text string, --voice id, --clone wav, --clone-transcript text, --out path, --device indexorname, --asset-root path, --options KEY=VALUEdownload: --stt, --tts, --g2p, --intent, --language tag, --voice id, --root dir (at least one of --stt / --tts / --g2p / --intent is required)g2p: -l / --language tag, --text string, --asset-root path, --no-downloadintent: --intents comma-list, --threshold float (default 0.8), --wav-file path, --embedding-model name, --quantization {fp32 | fp16 | q8 | q4 | q4f16}Each subcommand also accepts --help for its full flag list. Invoking python -m moonshine_voice.module with the same flags is equivalent.

COMMANDS

mic

Stream audio from the default microphone and print live transcript updates to the terminal.
transcribe
Transcribe a WAV file offline. Supports speaker diarization (--speaker-ids) and word-level timestamps (--word-timestamps).
tts
Synthesize speech from text to a WAV file or the default audio device. Optional ZipVoice cloning via --clone.
intent
Listen for user-defined action phrases (comma-separated) and report semantic matches with confidence.
download
Prefetch STT, TTS, G2P, or intent/embedding model assets into the local cache (or a custom --root).
g2p
Convert input text to International Phonetic Alphabet (IPA) using Moonshine's G2P engine.

INSTALL

yay -S moonshine
copy

CAVEATS

First-run model downloads need network access to download.moonshine.ai (or Hugging Face mirrors used by the package); after that, inference can be offline if assets are cached. Live mic modes need a working capture device and appropriate OS audio permissions. On Raspberry Pi OS, installing system-wide often requires pip install --break-system-packages (or a virtualenv). --clone TTS uses ZipVoice and is slower than Kokoro/Piper. The moonshine short name is only an alias for the same entry point, not a separate tool.

HISTORY

Moonshine's first-generation models were released with the paper *Moonshine: Speech Recognition for Live Transcription and Voice Commands* (arXiv:2410.15608). Later work added language-specific "Flavors of Moonshine" models and a second generation aimed at streaming latency and edge accuracy, culminating in the Moonshine Voice multi-platform library and moonshine-voice pip package (Python console scripts plus C++/Swift/Android bindings). The project is developed by Moonshine AI under the MIT License.

SEE ALSO

RESOURCES

Copied to clipboard
Kai