@wenjinnn/pi-mimo-voice1.1.1
Voice input and output for pi powered by Xiaomi MiMo V2.5 TTS
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-mimo-voice
π¨π³ δΈζζζ‘£
Voice input (STT) and output (TTS) for pi powered by Xiaomi MiMo V2.5 API.

π Please turn on sound for the demo below
https://github.com/user-attachments/assets/9a9f9984-9476-4c4e-bbeb-ae088a7d875c
Features
- π€ Speech-to-Text (STT) β Record audio from microphone and transcribe
- π Text-to-Speech (TTS) β Speak text aloud through speakers
- π£οΈ Auto-speak β Automatically read all assistant replies
- ποΈ Live mode β Continuous voice conversation loop
- ποΈ Interactive config β Voice, model, engine, and region settings
Installation
# Install from npm
pi install npm:@wenjinnn/pi-mimo-voice
# Or install from GitHub
pi install git:github.com/wenjinnn/pi-mimo-voice
# Or clone manually
cd ~/.pi/agent/extensions
git clone https://github.com/wenjinnn/pi-mimo-voice.git
Quick Start
# 1. Set API key (via environment variable or pi /login)
export XIAOMI_TOKEN_PLAN_CN_API_KEY="your-key" # China region
# Or: export XIAOMI_API_KEY="your-key" # Global
# 2. Restart pi or /reload
# 3. Try it
/speak Hello from MiMo!
/listen
/listen stop
Commands
Text-to-Speech
| Command | Description |
|---|---|
/speak <text> |
Speak text aloud using MiMo TTS |
Speech-to-Text
| Command | Description |
|---|---|
/listen |
Start recording (manual stop with /listen stop) |
/listen stop |
Stop recording and transcribe |
/listen auto-stop N |
Record for N seconds then transcribe |
/listen N |
Record for N seconds (max 60) then transcribe |
Auto-speak & Live Mode
| Command | Description |
|---|---|
/auto-speak |
Toggle auto-speak (read all assistant replies). Use /auto-speak on|off for explicit control |
/live |
Start/stop live voice mode (auto-speak ON, begins recording) |
/live reply |
Stop recording, transcribe, and send to LLM |
Live mode flow:
/liveβ recording starts- Speak when ready
/live replyβ transcribes and sends- AI responds β auto-speak reads it β next recording starts
- Repeat from step 2
/liveto stop
Configuration
| Command | Description |
|---|---|
/voice-config |
Interactive settings: voice, TTS model, STT engine, API region |
LLM Tools
When installed, the LLM can call these tools directly:
mimo_tts
Convert text to speech. Parameters:
text(required) β Text to speakstyle(optional) β Style instruction (e.g., "excited", "calm", "δΈεθ―")
mimo_stt
Record and transcribe speech. Parameters:
duration(optional) β Recording duration in seconds (default: 10, max: 60)auto_stop(optional) β Auto-stop when silence detected (default: false)
Voices
Preset Voices
| Voice | ID | Language | Gender |
|---|---|---|---|
| Default | mimo_default |
auto | auto |
| ε°η³ | ε°η³ |
zh | female |
| θθ | θθ |
zh | female |
| θζ | θζ |
zh | male |
| η½ζ‘¦ | η½ζ‘¦ |
zh | male |
| Mia | Mia |
en | female |
| Chloe | Chloe |
en | female |
| Milo | Milo |
en | male |
| Dean | Dean |
en | male |
TTS Models
| Model | Description |
|---|---|
mimo-v2.5-tts |
Preset voices (default) |
mimo-v2.5-tts-voicedesign |
Custom voice via text description |
mimo-v2.5-tts-voiceclone |
Clone voice from audio sample |
API Configuration
The extension auto-detects the API region from your pi auth.json provider:
| Provider | auth.json Key | Environment Variable | Region |
|---|---|---|---|
| Xiaomi MiMo | xiaomi |
XIAOMI_API_KEY |
Global |
| Token Plan CN | xiaomi-token-plan-cn |
XIAOMI_TOKEN_PLAN_CN_API_KEY |
China |
| Token Plan AMS | xiaomi-token-plan-ams |
XIAOMI_TOKEN_PLAN_AMS_API_KEY |
Amsterdam |
| Token Plan SGP | xiaomi-token-plan-sgp |
XIAOMI_TOKEN_PLAN_SGP_API_KEY |
Singapore |
Setup Options
Option 1: Environment Variable
export XIAOMI_TOKEN_PLAN_CN_API_KEY="your-key"
Option 2: pi /login
/login β Select provider β Enter API key
Option 3: auth.json
{
"xiaomi-token-plan-cn": { "type": "api_key", "key": "your-key" }
}
See pi providers docs for more details.
Requirements
- Node.js β₯ 18
- MiMo API key β configured via
pi /loginor environment variable (see API Configuration) - ffmpeg β for audio recording and playback (cross-platform)
Platform-Specific Audio Tools
| Platform | Recording | Playback (priority order) |
|---|---|---|
| Linux | parecord (PulseAudio) β ffmpeg |
paplay β aplay β ffplay β mpv |
| macOS | ffmpeg + avfoundation | afplay (built-in) β ffplay β mpv |
| Windows | ffmpeg + dshow | ffplay β mpv |
Linux: PulseAudio is recommended (parecord/paplay). ALSA (aplay) also works for playback.
macOS: No extra tools needed β afplay is built-in, ffmpeg handles recording via avfoundation.
Windows: Install ffmpeg and ensure it's in PATH. Default recording device is audio=ιΊ¦ε
ι£, override with MIC_DEVICE env var.
β οΈ Cross-platform note: macOS and Windows support is based on ffmpeg's platform-specific audio backends (avfoundation/dshow) but has not been fully tested on real hardware. Linux is the primary tested platform. If you encounter issues on macOS or Windows, please open an issue β feedback and contributions are very welcome!
Environment Variables
| Variable | Description |
|---|---|
MIC_DEVICE |
Override audio recording device (all platforms) |
WHISPER_MODEL |
Path to whisper.cpp model file |
npm Dependencies
The following dependencies are provided by pi automatically:
@earendil-works/pi-coding-agentβ pi extension API@earendil-works/pi-tuiβ pi TUI componentstypeboxβ type validation
Optional
- whisper.cpp β for local STT (faster, no API calls)
- Set path:
/voice-configβ Whisper.cpp Path - Download model:
whisper-cpp-download-ggml-model base
- Set path:
How It Works
TTS Flow
Text β MiMo TTS API β WAV audio β paplay/aplay/ffplay/mpv
STT Flow
Microphone β parecord/ffmpeg β WAV file β whisper.cpp or MiMo API β Text
Live Mode Flow
/live β Start recording
User speaks
/live reply β Stop recording β Transcribe β Send to LLM
LLM responds β Auto-speak reads response
Auto-start next recording
Feedback & Contributing
This project is actively maintained. If you have questions, bug reports, or feature requests:
- π Open an issue
- π Submit a pull request
- π¬ Share your experience and suggestions
Contributions of any kind are welcome!
License
MIT