Speak your thoughts. Paste them anywhere.
Local voice input for Ubuntu Desktop · Chinese-first · No online ASR API required
English | 简体中文
Quick Start · Model Downloads · Troubleshooting · Development
Ctrl + Space → Speak → Ctrl + Space → Copied → Paste into your application.
When taking notes, describing an experiment, or explaining a task to a coding assistant, you often know what you want to say before you finish typing it. VoiceInput turns that moment into a short dictation session, giving Ubuntu users an accessible way to enter Chinese text by voice.
It focuses on short desktop input: one small window, one shortcut, and a transcription delivered to your clipboard. Models run locally. Once downloaded, they require neither an internet connection nor an API key.
| Feature | What it means for you |
|---|---|
| Local and offline | No audio or transcript uploads, no online ASR calls, and no telemetry. |
| Live preview, refined final text | A streaming model shows words as you speak. After stopping, a separate model transcribes the full recording and restores punctuation. |
| Chinese-first with custom hotwords | Designed for Mandarin and Chinese mixed with technical English, with terms such as PyTorch, CARLA, and Diffusion Policy. |
| Global shortcut and system tray | On GNOME, Ctrl+Space starts or stops recording. Closing the window hides it to the tray and keeps models loaded. |
| Ready to paste | Final text is copied automatically. Cancellation, silence, and recognition failures leave the previous clipboard intact. |
| CPU by default | No dedicated GPU required. CUDA is an optional installation choice. |
| Conservative text cleanup | Tidies punctuation, Chinese–English spacing, full-width digits, and extra spaces without rewriting the meaning. |
See the validation record for what has actually been tested.
Recommended environment: Ubuntu 22.04 Desktop, Python 3.10, and a working default microphone.
Download or clone this repository, then run from the project root:
chmod +x install.sh
./install.shThe installer installs system dependencies, creates an isolated Python environment in your user data directory, and adds a “本地语音输入” (VoiceInput) application entry. Dependency installation requires internet access and uses CPU PyTorch by default.
If you already have the 0.2.0 amd64 deb package, you can install it directly:
sudo apt install ./voiceinput_0.2.0_amd64.debRun this command in the directory containing the package. Source builds place it in dist/; see the build guide. Choose one installation method. If you have used both, see launcher troubleshooting.
Open “本地语音输入” from the application menu and click “下载 / 重试加载模型” (Download / Retry loading models). The window shows the model name, download stage, and destination directory. Once downloaded, recognition works offline.
You can also download all four models from their official ModelScope pages and follow the manual download and offline setup guide to place and register the files. Model weights are not bundled with the application.
Wait until the window shows “开始语音输入” (Start voice input):
- Click Start or press Ctrl+Space.
- Speak into your default microphone and watch the live text and volume animation.
- Click Stop or press Ctrl+Space again.
- Wait for “正在整理……” (Processing…) to become “已复制” (Copied), then paste into your target application.
If Ctrl+Space conflicts with your input method, change the hotkey setting below. The shortcut toggles recording: press and release it once for each action.
The application interface and the detailed guides linked here are currently in Chinese. Both English and Chinese versions of this README are available.
| Action | Behavior |
|---|---|
| Cancel | Discards the current recording and result without changing the clipboard. |
| Click × | Hides the window to the tray, keeping models loaded. Hiding during recording does not stop it. |
| Click the tray icon or reopen the application entry | Restores the existing window without reloading models. |
| Choose “退出 VoiceInput” from the tray, click “退出”, or press Ctrl+Q in the window | Quits the application and releases resources. |
| Reach the recording limit | Stops automatically and produces the final transcription. The default limit is 120 seconds. |
Final text remains selectable in the window until the next recording. No transcription history is saved. If a system tray is unavailable, × minimizes the window normally.
The first launch creates ~/.config/voiceinput/config.toml. Restart after changing it:
device = "auto" # CPU installations use CPU; cpu can also be explicit
max_recording_seconds = 120 # 1–600 seconds
cpu_threads = 4 # 1–32
hotkey = "Ctrl+Space" # Try Ctrl+Alt+Space if there is a conflict
# input_device = 0 # Omit to use the system default microphoneAdd one word or phrase per line to ~/.config/voiceinput/hotwords.txt:
CARLA
NAVSIM
NuPlan
DiffusionDrive
Diffusion Policy
PyTorch
CUDA
Transformer
Hotwords reload at the start of each recording. Blank lines and # comments are supported, with up to 256 entries. They guide the final model; live previews may differ, and hotwords do not guarantee correct recognition of every English acronym.
The default CPU installation needs no additional configuration. For GPU inference, ./install.sh --cuda installs CUDA dependencies, and device = "auto" checks CUDA availability. Changing the configuration alone cannot enable GPU inference in a CPU deb installation. See the development guide.
VoiceInput uses FunASR, with separate stages for immediate feedback and final transcription:
flowchart LR
A[Microphone] --> B[In-memory audio buffer]
B --> C[Streaming ASR + VAD]
C --> D[Live preview]
B -->|Stop| E[Full-recording final ASR]
E --> F[Punctuation and text cleanup]
F --> G[Final text and clipboard]
| Stage | Model | Why it is used |
|---|---|---|
| Live preview | Paraformer Streaming | Chinese streaming recognition with caching and continuous audio input. |
| Final transcription | SeACo Paraformer | A fresh transcription from the full recording, with hotword support. |
| Voice detection | FSMN-VAD | Detects speech, assists segmentation, and filters empty recordings. |
| Punctuation | Chinese–English CT-Punc | Restores punctuation locally. |
Official model links, directory layout, and manual download instructions →
Models load at startup and remain in memory. Audio capture and inference run separately from the GUI. The final result is independently recognized from the full recording, rather than assembled from preview text. See the threading and state design.
Audio stays in memory and is released after completion or cancellation. No temporary recording files are created. Logs contain state, device, backend, timing, and exception types—not complete transcripts or raw audio. A hotword snapshot is temporarily written to the local state directory and deleted after recognition.
| Default location | Contents |
|---|---|
~/.config/voiceinput/ |
Configuration and hotwords |
~/.local/share/voiceinput/models/ |
Local models |
~/.local/share/voiceinput/runtime/ |
Runtime created by the source installer |
~/.local/state/voiceinput/ |
Rotating logs, instance lock, and launcher repair backups |
Paths respect XDG environment variables. Installing dependencies and explicitly downloading models require a network connection. Everyday recognition reads local models and does not automatically update weights.
- Primary platform: Ubuntu 22.04 / GNOME. Desktop integration has been tested on X11. Wayland needs more real-world testing; the compositor may restrict window positioning and always-on-top behavior.
- Input: Short Mandarin dictation and Chinese mixed with technical English. English-only speech, dialects, complex acronyms, and noisy environments need further evaluation.
- Latency: Streaming chunks are approximately 600 ms. Lookahead, hardware, and inference add latency; a fixed response time is not guaranteed.
- Resources: Four models load on startup. Keeping the app in the tray avoids repeated loading. Recordings default to a 120-second limit; long meeting transcription is outside the current scope.
- Desktop integration: Automatic global shortcut setup targets GNOME. Other desktops can bind the launcher command with
--toggle-recordingmanually. The app copies text for you to paste; it does not inject keystrokes into other applications.
For shortcut conflicts, missing tray icons, audio devices, and mixed installation entries, see Troubleshooting.
Reproducible bug reports, documentation improvements, and focused changes are welcome. Testing with different microphones, GNOME Wayland, mixed Chinese–English terminology, and repeated recording sessions is especially useful.
When reporting an issue, include your Ubuntu version, X11 / Wayland session, installation method, CPU / CUDA backend, reproduction steps, and relevant logs you have reviewed. Private recordings and complete transcripts are not required.
See the development guide for setup, testing, and deb builds, and the validation record for completed checks and remaining gaps.
Built on FunASR, ModelScope, Qt for Python, python-sounddevice, and other open projects.
Original source code and documentation in this project are licensed under CC BY-SA 4.0 (Creative Commons Attribution-ShareAlike 4.0 International). See LICENSE for the full terms. Model weights and third-party dependencies retain their respective licenses.
