Installation
Python Package (Recommended)
Install via pip
The easiest way to use Moonshine Voice on Linux:This installs the Python package with pre-built native libraries.
C++ Library
Build with CMake
Build the core library:This creates:
libmoonshine.so- Shared library- Test executables in
build/
Quick Start Examples
Python Usage
See the Python Platform Guide for detailed Python usage.C++ Transcription
Minimal C++ example using the library:Streaming C++ Example
Building from Source
CMake Build Options
Linking Against Moonshine
In yourCMakeLists.txt:
Compiler Support
Moonshine requires C++20. Supported compilers:- GCC 10 or later
- Clang 12 or later
Audio Setup
ALSA Configuration
For microphone access with ALSA:PulseAudio
For PulseAudio systems:Python Audio (sounddevice)
The Python package uses sounddevice, which works with ALSA/PulseAudio:ARM/ARM64 Support
Moonshine works on ARM-based Linux systems:Raspberry Pi
See the dedicated Raspberry Pi guide for Pi-specific instructions.Distribution-Specific Notes
Ubuntu/Debian
Fedora/RHEL
Arch Linux
Model Management
Download Location
Models are cached in:Available Models
Performance
Benchmarking
Test performance on your hardware:- Absolute processing time
- Percentage of audio duration (compute load)
- Average response latency
Performance Tips
- Use streaming models - Lower latency for real-time apps
- Choose appropriate model - Balance accuracy vs performance
- Optimize build - Use Release mode with CMake
- Consider CPU - Modern CPUs (AVX2) perform significantly better
Expected Performance
| CPU | Model | Latency | Load |
|---|---|---|---|
| Intel i7-10700 | Tiny Streaming | 69ms | 7% |
| Intel i7-10700 | Base | 95ms | 10% |
| Intel i7-10700 | Small Streaming | 165ms | 17% |
| AMD Ryzen 5 5600X | Tiny Streaming | 52ms | 5% |
| AMD Ryzen 5 5600X | Base | 78ms | 8% |
Troubleshooting
Library Not Found
CMake Errors
Audio Device Issues
Python Import Errors
Docker Support
Use Moonshine Voice in containers:Example Projects
The repository includes C++ examples:- transcriber.cpp - Basic file transcription
- Located in
examples/c++/
Next Steps
C++ API Reference
Detailed C++ API documentation
Python Guide
Using Python on Linux
Models
Available models and architectures
Building from Source
Advanced build options