A real-time voice chat application that combines speech-to-text transcription, large language model conversations, and text-to-speech synthesis. Built with Rust backend and WebAssembly frontend for high performance and browser compatibility.

sudo apt update
sudo apt install ffmpeg espeak-ng ollama
cargo install wasm-pack
sudo pacman -S ffmpeg espeak ollama
cargo install wasm-pack
brew install ffmpeg espeak ollama
cargo install wasm-pack
# Start Ollama service
ollama serve
# Pull default model (in another terminal)
ollama pull gemma3:12b
git clone https://github.com/danielclough/voice-chat-whisper-ollama-espeak-wasm
cd chatter
# Build frontend WebAssembly module
./build_frontend.sh
# Build and run backend
cargo check && cargo build
cargo run
Navigate to http://127.0.0.1:3000 in your browser.
Browser β Record Audio (WebM) β Upload to /api/transcribe β
FFmpeg Conversion β Whisper Transcription β /api/chat β
Ollama LLM β Response β eSpeak TTS β Audio File β Browser Playback
Edit config.yaml to customize application behavior:
server:
host: "127.0.0.1"
port: 3000
cors_enabled: true
message_max_length: 10000
chat:
default_model: "gemma3:12b" # Default Ollama model
api_endpoint: "http://localhost:11434" # Ollama server URL
timeout_seconds: 30
transcription:
model_repo: "openai/whisper-tiny" # Whisper model size
device: "auto" # auto, cpu, cuda
language: "auto" # auto or language code
quantized: true # Use quantized model for faster inference
audio:
max_file_size_mb: 100
supported_formats: ["wav", "mp3", "m4a", "flac"]
sample_rate: 16000
pitch: "60" # eSpeak pitch setting
amplitude: "100" # eSpeak volume setting
Send text message to LLM and get response with audio.
Request:
{
"message": "Hello, how are you?",
"model": "gemma3:12b" // optional
}
Response:
{
"response": "I'm doing well, thank you for asking!",
"audio_url": "/api/audio/uuid.wav"
}
Upload audio file for speech-to-text transcription.
Request: Multipart form with audio field
Response:
{
"text": "Transcribed speech content"
}
Serve generated audio files.
Response: WAV audio file with appropriate headers
# Development build
cd frontend
wasm-pack build --target web --out-dir ../static/pkg --dev
# Or use the build script
./build_frontend.sh
# Backend with hot reload (cargo-watch)
cargo install cargo-watch
cargo watch -x "check && run"
# Frontend rebuild on changes
cd frontend
wasm-pack build --target web --out-dir ../static/pkg --dev --watch
Common models you can install:
gemma3:12b (default) - Google's Gemma 3 modelllama3.2 - Meta's Llama 3.2llama3.1 - Meta's Llama 3.1codellama - Code-specialized Llamamistral - Mistral AI modelphi3 - Microsoft's Phi-3ollama pull <model-name>
Error: FFmpeg is not available
# Install FFmpeg
# macOS: brew install ffmpeg
# Ubuntu: sudo apt install ffmpeg
# Verify: ffmpeg -version
Error: Browser blocks microphone access
Error: Failed to connect to Ollama
# Check Ollama is running
ollama serve
# Verify model is installed
ollama list
# Test API manually
curl http://localhost:11434/api/generate -d '{"model":"gemma3:12b","prompt":"test"}'
Error: wasm-pack not found
cargo install wasm-pack
Error: eSpeak not found
brew install espeak or sudo apt install espeak-ngFor GPU acceleration:
# Ensure CUDA is installed and compatible
# Rebuild with CUDA features enabled
cargo build --features cuda
This project is dual-licensed under:
Rust
89.4%
HTML
10.2%
A real-time voice chat application that combines speech-to-text transcription, large language model conversations, and text-to-speech synthesis. Built with Rust backend and WebAssembly frontend for high performance and browser compatibility.

sudo apt update
sudo apt install ffmpeg espeak-ng ollama
cargo install wasm-pack
sudo pacman -S ffmpeg espeak ollama
cargo install wasm-pack
brew install ffmpeg espeak ollama
cargo install wasm-pack
# Start Ollama service
ollama serve
# Pull default model (in another terminal)
ollama pull gemma3:12b
git clone https://github.com/danielclough/voice-chat-whisper-ollama-espeak-wasm
cd chatter
# Build frontend WebAssembly module
./build_frontend.sh
# Build and run backend
cargo check && cargo build
cargo run
Navigate to http://127.0.0.1:3000 in your browser.
Browser β Record Audio (WebM) β Upload to /api/transcribe β
FFmpeg Conversion β Whisper Transcription β /api/chat β
Ollama LLM β Response β eSpeak TTS β Audio File β Browser Playback
Edit config.yaml to customize application behavior:
server:
host: "127.0.0.1"
port: 3000
cors_enabled: true
message_max_length: 10000
chat:
default_model: "gemma3:12b" # Default Ollama model
api_endpoint: "http://localhost:11434" # Ollama server URL
timeout_seconds: 30
transcription:
model_repo: "openai/whisper-tiny" # Whisper model size
device: "auto" # auto, cpu, cuda
language: "auto" # auto or language code
quantized: true # Use quantized model for faster inference
audio:
max_file_size_mb: 100
supported_formats: ["wav", "mp3", "m4a", "flac"]
sample_rate: 16000
pitch: "60" # eSpeak pitch setting
amplitude: "100" # eSpeak volume setting
Send text message to LLM and get response with audio.
Request:
{
"message": "Hello, how are you?",
"model": "gemma3:12b" // optional
}
Response:
{
"response": "I'm doing well, thank you for asking!",
"audio_url": "/api/audio/uuid.wav"
}
Upload audio file for speech-to-text transcription.
Request: Multipart form with audio field
Response:
{
"text": "Transcribed speech content"
}
Serve generated audio files.
Response: WAV audio file with appropriate headers
# Development build
cd frontend
wasm-pack build --target web --out-dir ../static/pkg --dev
# Or use the build script
./build_frontend.sh
# Backend with hot reload (cargo-watch)
cargo install cargo-watch
cargo watch -x "check && run"
# Frontend rebuild on changes
cd frontend
wasm-pack build --target web --out-dir ../static/pkg --dev --watch
Common models you can install:
gemma3:12b (default) - Google's Gemma 3 modelllama3.2 - Meta's Llama 3.2llama3.1 - Meta's Llama 3.1codellama - Code-specialized Llamamistral - Mistral AI modelphi3 - Microsoft's Phi-3ollama pull <model-name>
Error: FFmpeg is not available
# Install FFmpeg
# macOS: brew install ffmpeg
# Ubuntu: sudo apt install ffmpeg
# Verify: ffmpeg -version
Error: Browser blocks microphone access
Error: Failed to connect to Ollama
# Check Ollama is running
ollama serve
# Verify model is installed
ollama list
# Test API manually
curl http://localhost:11434/api/generate -d '{"model":"gemma3:12b","prompt":"test"}'
Error: wasm-pack not found
cargo install wasm-pack
Error: eSpeak not found
brew install espeak or sudo apt install espeak-ngFor GPU acceleration:
# Ensure CUDA is installed and compatible
# Rebuild with CUDA features enabled
cargo build --features cuda
This project is dual-licensed under:
Rust
89.4%
HTML
10.2%