A lightweight, open-source voice typing application that converts speech to text using local inference with Whisper models. Record and transcribe audio with a simple keyboard shortcut for seamless integration with any application.
- Keyboard-Driven: Toggle recording with a configurable hotkey (default:
Cmd+Alt) - Local Inference: Uses whisper.cpp via the PyWhisperCPP wrapper for offline, private speech recognition
- Universal Compatibility: Works with any application that accepts pasted text
- Simple Interface: No GUI required - just press the hotkey, speak, and release to insert text
- Customizable: Configure your preferred language model and hotkey
- Python 3.8 or higher
- A working microphone
- Linux, macOS, or Windows
-
Clone this repository:
git clone https://github.com/lladdy/voice-typing.git cd voice-typing -
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the application:
python run.py
-
Press and hold your configured hotkey (default:
Cmd+Alt) to start recording. -
Speak clearly into your microphone.
-
Release the hotkey to stop recording and transcribe.
-
The text will be automatically pasted at your cursor position.
You can customize the application by modifying the VoiceTyperConfig in run.py:
config = VoiceTyperConfig(
recording_hotkey="<cmd>+<alt>", # Change to your preferred hotkey
model_name="base.en" # Change to use different Whisper models
)Available model options:
tiny.en: Fastest but less accurate (English only)base.en: Good balance of speed and accuracy (English only)small.en: More accurate but slower (English only)medium.en: Most accurate but requires more resources (English only)tiny,base,small,medium: Multilingual versions
run.py: Entry point for the applicationvoice_typer.py: Core application logicaudio.py: Audio recording and processingspeech_to_text.py: Speech recognition using Whisper.cppkeyboard.py: Keyboard interaction and hotkey handling
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Whisper by OpenAI
- whisper.cpp for efficient local inference
- PyWhisperCPP for Python bindings to whisper.cpp