A Python program for voice-controlled typing using the Vosk speech recognition engine.
- Start dictation with the wake word: Jarvis
- End dictation with any of the following phrases:
- Jarvis done
- Jarvis send
- Jarvis go
- Jarvis enter
- Jarvis finish
- Automatically types the transcribed text into the focused window
- Easy to use, works on Windows
- Python 3.7+
- Vosk speech recognition library
- sounddevice
- pyautogui
- Vosk English model (see below)
- Create the environment:
conda env create -f environment.yml
- Activate the environment:
conda activate code-by-voice
- Install dependencies:
pip install vosk sounddevice pyautogui
- Go to Vosk Models
- Download
vosk-model-small-en-us-0.15(or a larger model for better accuracy) - Extract the model to the
models/directory so the path is:models/vosk-model-small-en-us-0.15/
- Focus the text box or window where you want the text to be typed.
- Run the program:
python transcribe_vosk.py
- Follow the instructions in the terminal:
- Say "Jarvis" to start dictation.
- Speak your message.
- End with any of: "Jarvis done", "Jarvis send", "Jarvis go", "Jarvis enter", or "Jarvis finish".
- The program will type your message and press Enter.
Say:
Jarvis write hello world jarvis send
The program will type: write hello world and press Enter.
This project is compatible with modern AI-powered coding environments such as Cursor, GitHub Copilot, and other AI copilots. You can use Code-By-Voice to:
- Dictate code, commands, or documentation directly into your editor using your voice.
- Combine voice control with AI assistance for a hands-free, productivity-boosting workflow.
- Leverage Cursor's AI agent or other copilots to generate, refactor, or explain code, while using your voice to trigger actions or input text.
- Start Code-By-Voice and focus your Cursor editor or terminal.
- Say:
Jarvis write a Python function that adds two numbers jarvis send The text will be typed into your editor. - Let your AI copilot (e.g., Cursor AI, Copilot, ChatGPT) complete, refactor, or explain the code as needed.
- Use your voice to continue coding, documenting, or running commands.
- Hands-free coding: Great for accessibility, multitasking, or reducing repetitive strain.
- Seamless integration: Works with any editor or tool that accepts keyboard input.
- AI + Voice: Combine the power of AI code generation with natural language voice input.
- Make sure your microphone is working and set as the default input device.
- The program will not work without the Vosk model in the correct directory.
- Large model files and temporary files should not be committed to the repository. See
.gitignorefor details.
MIT (or your preferred license)