Overview
Moonshine Voice provides native packages for all major platforms using standard package managers. Choose your platform below:Python
pip install
iOS/macOS
Swift Package Manager
Android
Maven/Gradle
Windows
Visual Studio
Linux
CMake build
Raspberry Pi
Python pip
Python
The easiest way to get started with Moonshine Voice.Installation
Requirements
- Python: 3.8 or newer
- Dependencies: numpy, sounddevice, requests, tqdm, filelock, platformdirs (installed automatically)
- Platforms: Linux, macOS, Windows
Quick Test
Verify installation by transcribing from your microphone:Import in Code
iOS and macOS
Moonshine Voice uses Swift Package Manager for iOS and macOS integration.Swift Package Manager
Enter Repository URL
In the dialog, paste the repository URL:Select
moonshine-swift when it appears and click Add Package.Requirements
- iOS: 14.0 or later
- macOS: 13.0 or later
- Xcode: 13.0 or later
Example Projects
Download ready-to-run examples:Package.swift (for Libraries)
If you’re building a library that depends on Moonshine:Package.swift
Android
Moonshine Voice is distributed via Maven Central for Android projects.Gradle Setup
Add Version to libs.versions.toml
In your
gradle/libs.versions.toml file, add:gradle/libs.versions.toml
Add Dependency to build.gradle.kts
In your
app/build.gradle.kts, add to dependencies:app/build.gradle.kts
Requirements
- Android SDK: 21 (Android 5.0) or higher
- Build System: Gradle 7.0+
- Languages: Kotlin or Java
Example Project
Download a complete Android Studio project:Maven Central
View the package on Maven Central: ai.moonshine:moonshine-voiceWindows
For Windows developers using Visual Studio and C++.Download Library Files
Download C++ Library
Use the provided download script from the examples:This downloads the library files and headers to a local directory.
Visual Studio Project Setup
To add Moonshine to your own Visual Studio project:- Add Include Directory: Add the
includefolder to your project’s include search paths - Add Library Directory: Add the
libfolder to your library search paths - Link Libraries: Add all
.libfiles from thelibfolder to linker dependencies - Include Header:
#include "moonshine-cpp.h"in your C++ code
Requirements
- Visual Studio: 2019 or later
- Platform: x64 only
- Language: C++17 or later
Linux
Build from source using CMake for native Linux applications.Build from Source
Python Installation (Easier)
For most Linux users, the Python package is the simplest option:Requirements
- Compiler: GCC 7+ or Clang 6+
- CMake: 3.15 or later
- Dependencies: Included via submodules
Build Script
Use the automated test script:Raspberry Pi
Moonshine Voice is optimized for Raspberry Pi with special performance tuning.Installation
Using Virtual Environment (Recommended)
To avoid system package conflicts:Performance
On Raspberry Pi 5:| Model | Latency |
|---|---|
| Tiny Streaming | 237ms |
| Small Streaming | 527ms |
| Medium Streaming | 802ms |
Example Projects
Download Pi-specific examples:Video Tutorial
Watch the Raspberry Pi setup screencast on YouTube.Model Installation
All platforms require downloading model files before use.Download Models
Supported Languages
| Language | Code | Model Size |
|---|---|---|
| English | en | Multiple (tiny to medium) |
| Spanish | es | Base |
| Mandarin | zh | Base |
| Japanese | ja | Base |
| Korean | ko | Tiny |
| Vietnamese | vi | Base |
| Ukrainian | uk | Base |
| Arabic | ar | Base |
Model Cache Location
Models are cached in:- macOS
- Linux
- Windows
Available Model Architectures
Frommoonshine-c-api.h:
0- Tiny (26M params, 12.66% WER)1- Base (58M params, 10.07% WER)2- Tiny Streaming (34M params, 12.00% WER)3- Small Streaming (123M params, 7.84% WER)4- Medium Streaming (245M params, 6.65% WER)
If no architecture is specified, the highest-quality model available for that language is downloaded.
Verification
Test your installation:- Python
- Swift
- Android
- C++
Building from Source
For advanced users who want to customize the library.Prerequisites
- CMake: 3.15+
- C++ Compiler: C++17 support
- Git: For cloning submodules
Complete Build
Build All Platform Packages
To build packages for all platforms (requires platform SDKs):- Python wheel
- Swift framework
- Android AAR
- Windows DLLs
Language Bindings
Binding source code locations:- Python:
python/src/moonshine_voice/ - Swift:
swift/Sources/MoonshineVoice/ - Android:
android/src/main/java/ - C++ Header:
core/moonshine-cpp.h
Troubleshooting
Python: Module not found
Python: Module not found
iOS/macOS: Package not found
iOS/macOS: Package not found
- Ensure Xcode is up to date
- Try deleting derived data:
rm -rf ~/Library/Developer/Xcode/DerivedData - Verify internet connection (SPM needs to download)
- Check minimum deployment target (iOS 14+, macOS 13+)
Android: Build errors
Android: Build errors
- Verify Gradle version is 7.0+
- Check
minSdkis 21 or higher - Sync Gradle files
- Clean and rebuild:
./gradlew clean build
Windows: Link errors
Windows: Link errors
- Ensure you’re building for x64 (not x86)
- Verify all
.libfiles are in linker dependencies - Check include paths point to the
includefolder - Use Visual Studio 2019 or later
Linux: CMake fails
Linux: CMake fails
Raspberry Pi: Permission denied
Raspberry Pi: Permission denied
Next Steps
Quickstart Guide
Start transcribing in under 2 minutes
Python API Guide
Complete API reference and examples
Examples
Platform-specific code examples
Model Selection
Choose the right model for your needs
Support
Need help with installation?Discord Community
Get live support from the team
GitHub Issues
Report installation problems