VoiceChat is a real-time multi-peer voice chat application built with WebRTC and WebSocket signaling. It includes an integrated AI agent for in-room assistance.
🤖 AI Agent Chat
Click the AI Chat button (🤖) in the room header or bottom controls to open the AI assistant. Three modes:
💬 Text — Type messages to the AI (classic chat)
🎙️ Voice — Talk to the AI using your microphone, it responds with voice (uses your browser's speech recognition + text-to-speech)
⚙️ Settings — Configure provider, model, API keys, system prompt, temperature, and voice settings
AI providers are configured in the Settings tab. API keys are stored locally in your browser.
🌐 Connection Types
The application supports multiple connection strategies:
Direct (host-to-host) - Peers connect directly when both have publicly routable addresses
STUN (server reflexive) - Peers use STUN server to discover public addresses
TURN (relay) - All media flows through a relay server (coturn) - essential for NAT traversal
⚙️ Settings
Adjust your audio device routing and network behavior here:
Echo Cancellation - Reduces audio feedback when speakers are near microphones
Noise Suppression - Filters background noise
Auto Gain Control - Auto adjusts microphone level
Force TURN Relay - Forces all media through TURN server (useful for testing)
Debug Logging - Enables verbose console logging
Show Connection Info - Displays detailed network info for each peer
🎧 Device Routing
Select specific audio input/output devices for better performance on systems with multiple audio devices.
🔌 Network Topology
The mesh topology connects every participant directly to every other participant.
Advantages: Low latency when direct connections work
Limitations: Requires public IP addresses or NAT traversal (STUN/TURN)
💾 Persistence
All settings are saved to localStorage and automatically restored on app refresh.
🔨 Troubleshooting
No AI Chat button: Make sure you're inside a room (not the lobby). Hard refresh (Ctrl+Shift+R).
Provider not configured: Open the AI Chat → Settings tab and enter your API key.
Voice mode not working: Voice mode requires a browser with Web Speech API support (Chrome, Edge, Safari). Make sure mic permissions are granted.
No audio: Check browser mic permissions and input device in Settings.
All TURN: Normal on home networks. TURN ensures connectivity through restrictive NAT.
🤖 AI Agent
Provider: —Key: —Model: —
🤖
Hi! I'm the AI assistant for this voice chat room. Ask me anything!
🤖
Tap Start Conversation to begin
🎧 Listening🗣️ Speaking🧠 Thinking🎤 Mic
Provider
API Keys (stored locally in your browser)
•••• saved
•••• saved
•••• saved
Behavior
Lower = more focused, higher = more creative
Ollama/LLM Settings
URL for local Ollama or LLM server. Default: http://ollama:11434 (Docker internal). Your custom URL is saved automatically.
Voice Settings
Conversation Settings
How long to wait after you stop speaking before sending to AI. Lower = faster response, higher = more time to think.