Skip to content

roshinjimmy/mic-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MicBot – Offline Voice-Controlled Assistant

MicBot is a command-line assistant that listens to your voice (offline), converts it to text, matches it to known commands (even approximately), and executes system actions on your computer.

Features

  • Offline Speech-to-Text: Uses Vosk for fast, private voice recognition.
  • Fuzzy Command Matching: Matches your spoken command to a set of known commands, even if phrased differently.
  • System Command Execution: Runs matched commands on your system (Linux, macOS).
  • Configurable: Add or edit commands in config/commands.json.

Setup

  1. Clone the repository and enter the directory:
    git clone <repo-url>
    cd mic-bot
  2. Create and activate a virtual environment:
    python3 -m venv venv
    source venv/bin/activate
  3. Install dependencies:
    pip install -r requirements.txt
  4. Download a Vosk model:

Usage

Run the assistant:

python3 main.py
  • Speak a command (e.g., "open browser", "shutdown", "open vscode").
  • If your command matches (fuzzily) a key in config/commands.json, it will be executed.
  • Say "stop" to exit.

Project Structure

main.py                  # Main program loop
recognizer/stt.py        # Speech-to-text (Vosk)
matcher/command_mapper.py# Fuzzy command matching
executor/command_runner.py# Command execution
config/commands.json     # Your command config
ui/console_ui.py         # (For future UI improvements)

Customizing Commands

Edit config/commands.json to add or change commands. Example for Linux:

{
  "open browser": "xdg-open https://www.google.com",
  "shutdown": "shutdown -h now",
  "restart": "shutdown -r now",
  "lock": "cinnamon-screensaver-command -l",
  "open vscode": "code",
  "open notepad": "gedit",
  "open explorer": "xdg-open .",
  "open cmd": "gnome-terminal",
  "open powershell": "gnome-terminal"
}

Requirements

  • Python 3.8+
  • Linux (tested on Linux Mint Cinnamon, should work on most distributions)
  • Python 3.8+
  • PortAudio (for sounddevice):
    sudo apt-get install portaudio19-dev

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages