Skip to content

Repository files navigation

Claude Voice — Gaming Companion

A voice-activated AI assistant powered by Claude, with wake word detection, push-to-talk, local speech-to-text (Whisper), and local text-to-speech (Piper).

Prerequisites

  • Python 3.10+
  • Piper TTS installed and on your PATH
  • A working microphone and speakers/headphones
  • An Anthropic API key
  • Linux (uses evdev for push-to-talk key detection)

Setup

  1. Clone the repo and open it in VS Code / Cursor:

    git clone https://github.com/pulsipd/claude-voice.git
    cd claude-voice
    code .   # or: cursor .
  2. Create a virtual environment and install dependencies:

    Open a terminal in VS Code/Cursor (`Ctrl+``) and run:

    python3 -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
  3. Set your Anthropic API key:

    export ANTHROPIC_API_KEY="sk-ant-..."

    To make it permanent, add that line to your ~/.bashrc or ~/.zshrc.

  4. Install Piper TTS:

    pip install piper-tts

    Or follow the install instructions at https://github.com/rhasspy/piper.

Running

With the virtual environment activated:

python3 claude-voice.py

On first run it will automatically download:

  • A Whisper speech-to-text model (~150 MB)
  • A Piper voice (~30 MB)

These are cached in the models/ directory.

Usage

The app has two input modes:

  • Voice mode (default) — Say the wake word (default: "Hey Jarvis") to start listening. It stops recording after detecting silence.
  • Push-to-talk mode — Hold the Scroll Lock key to record, release to send.

You can also type questions directly into the terminal.

Commands

Command Description
/help Show all commands
/quit Exit the app
/clear Clear conversation history
/model [name] Show or set Claude model (sonnet, opus, haiku)
/mode [voice|ptt] Switch between voice and push-to-talk
/wake [model] List or change wake word model
/voice [name] List or switch TTS voice
/voice download <name> Download a new Piper voice
/devices List audio input/output devices
/input <id> Set audio input device
/output <id> Set audio output device

Available Voices

Run /voice to see all options. Some highlights:

Name Description
lessac US female, clear and neutral
amy US female, warm and friendly
joe US male, casual and upbeat
alan British male, deep and composed
jenny British female, expressive
ryan US male, broadcaster style

Download with /voice download <name>, then switch with /voice <name>.

Troubleshooting

  • "ANTHROPIC_API_KEY not set" — Make sure you exported the key in the same terminal session.
  • "piper not found" — Install with pip install piper-tts or check it's on your PATH.
  • No audio input — Run /devices to list devices, then /input <id> to pick the right mic.
  • Wake word not working — Try /mode ptt as a fallback or /wake to see available models.
  • Permission error on key detection — Push-to-talk uses evdev and may need your user in the input group: sudo usermod -aG input $USER (then log out/in).

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages