Skip to content

Repository files navigation

Skeletor Voice Assistant

A hands-free voice assistant for the Distiller Alpha CM5 device using Claude AI - with the personality and voice of Skeletor!

Features

  • Wake word activation: Say "Skeletor" to activate the assistant
  • Skeletor personality: Claude responds as the evil overlord from He-Man, with theatrical villainy and dark humor
  • Skeletor voice: Deep, menacing voice with pitch-shifted audio (18kHz playback for deeper tone)
  • Natural conversation: Powered by Claude 3.5 Sonnet
  • Voice input: Uses Parakeet speech-to-text with voice activity detection
  • Voice output: Uses Piper text-to-speech with pitch modification
  • Conversation memory: Maintains context across multiple interactions

Setup

1. Set your Anthropic API Key

export ANTHROPIC_API_KEY='your-api-key-here'

To make this permanent, add it to your ~/.bashrc:

echo "export ANTHROPIC_API_KEY='your-api-key-here'" >> ~/.bashrc
source ~/.bashrc

2. Install the anthropic Python package

source /opt/distiller-cm5-sdk/activate.sh
cd /opt/distiller-cm5-sdk
uv add anthropic

3. Run the assistant

source /opt/distiller-cm5-sdk/activate.sh
cd "/home/distiller/projects/hands free assistant"
python skeletor_assistant.py

Usage

  1. Start the assistant: Run the script as shown above
  2. Activate with wake word: Say "Skeletor" clearly
  3. Wait for confirmation: The assistant will respond with "Yes?"
  4. Speak your command: You have ~5 seconds to speak your question or command
  5. Listen to response: Claude will process and respond via voice
  6. Repeat: The assistant continues listening for the wake word

How It Works

  1. Continuous Listening: Uses VAD (Voice Activity Detection) to monitor audio
  2. Wake Word Detection: Transcribes speech and checks for "Skeletor"
  3. Command Capture: After wake word, records ~5 seconds for your command
  4. Claude Processing: Sends transcribed text to Claude API with Skeletor personality prompt
  5. Voice Response: Converts Claude's text response to speech via Piper TTS with pitch-shifted audio to sound like Skeletor (deeper, more menacing)

Troubleshooting

No API Key Error

Make sure you've exported ANTHROPIC_API_KEY in your environment.

Audio Issues

  • Check microphone: arecord -l
  • Check speaker: aplay -l
  • Ensure user is in audio group: groups

Wake Word Not Detected

  • Speak clearly and enunciate "Skeletor"
  • Check microphone gain (automatically set to 85)
  • Look at logs to see what text is being transcribed

Assistant Not Responding

  • Check API key is valid
  • Ensure internet connection is working
  • Look at logs for API errors

Customization

Change Wake Word

Edit skeletor_assistant.py and modify:

self.wake_word = "your-wake-word"

Adjust Volume

Change the volume parameter in the run() call:

assistant.run(volume=80)  # 0-100

Change Claude Model

Modify the model in process_with_claude():

model="claude-3-5-sonnet-20241022"  # or other Claude models

Adjust Recording Timeout

Change timeout in listen_for_command():

command = self.listen_for_command(timeout=10)  # seconds

Adjust Skeletor Voice Pitch

In the speak() method, change the playback sample rate:

# Lower rate = deeper voice (Skeletor default: 18000)
# Original pitch: 22050
# Deeper: 16000-18000
# Even deeper: 14000-16000
playback_cmd = f"aplay -D plughw:{hw_num} -r 18000 {tmp_path}"

Disable Skeletor Personality

Remove or modify the system parameter in process_with_claude() to use a normal assistant personality

Exit

Press Ctrl+C to stop the assistant.

About

Hands-free voice assistant with Skeletor personality for Raspberry Pi CM5 (Distiller Alpha). Local LLM support, authentic voice synthesis, wake word detection.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages