Skip to content

Repository files navigation

Voice Chat App

A voice-enabled chat application with ElevenLabs TTS integration.

Features

  • 🎙️ Voice Input - Speech-to-text using Web Speech API
  • 🔊 Voice Output - High-quality TTS via ElevenLabs
  • 💬 AI Chat - Powered by OpenClaw/Ollama
  • 🌐 Web Interface - Clean, responsive UI

Quick Start

1. Install Dependencies

pip install -r requirements.txt

2. Configure ElevenLabs (Optional)

The app works with a default API key, but you can use your own:

  1. Get your API key from elevenlabs.io
  2. Set it as an environment variable:
    export ELEVENLABS_API_KEY="your-api-key"

3. Run the Server

python voice-server.py

4. Open in Browser

Navigate to: http://localhost:8080

Available Voices

Voice ID Name Description
EXAVITQu4vr4xnSDxMaL Sarah Warm, professional (default)
XB0fDUnXU5powFXDhCwa Charlotte Calm, gentle
MF3mGyEYCl7XYWbV9V6O Elli Energetic, friendly
TxGEqnHWrfWFTfGW9XjX Josh Deep, authoritative
VR6AewLTigWG4xSOukaG Adam Natural, versatile

To use a different voice, modify DEFAULT_VOICE in voice-server.py.

Project Structure

├── voice-server.py          # Main server with ElevenLabs TTS
├── voice-chat.html          # Main chat interface
├── voice-simple.html        # Minimal version
├── voice-debug.html         # Debug utilities
├── voice-app/               # Alternative Flask/WebSocket server
│   ├── server.py
│   └── static/
└── requirements.txt         # Python dependencies

API Endpoints

  • GET / - Serve chat interface
  • GET /health - Health check
  • POST /v1/tts - Text-to-speech (returns audio/mp3)
  • POST /v1/chat - Chat completion

Environment Variables

Variable Description Default
ELEVENLABS_API_KEY ElevenLabs API key Built-in key
DEFAULT_VOICE Default voice ID Sarah
PORT Server port 8080

License

MIT

About

Voice chat application with TTS

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages