Use when working with Quetrex's voice interface, OpenAI Realtime API, WebRTC, or echo cancellation. Knows Quetrex's specific voice architecture decisions and patterns. CRITICAL - prevents breaking working voice system.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Use when working with Quetrex's voice interface, OpenAI Realtime API, WebRTC, or echo cancellation. Knows Quetrex's specific voice architecture decisions and patterns. CRITICAL - prevents breaking working voice system.
allowed-tools
Read
Quetrex Voice System Expert
CRITICAL: Read This First
Quetrex's voice system architecture is extensively documented and battle-tested. Before making ANY changes to voice-related code, you MUST read:
// Microphone track stays ENABLED throughout conversation
// Browser's native AEC prevents feedback loops
// Server-side VAD (Voice Activity Detection) handles turn detection
How It Works
Audio Pipeline
User speaks
↓
Microphone (always enabled, echoCancellation: true)
↓
WebRTC → OpenAI Realtime API
↓
Server-side VAD detects speech
↓
OpenAI processes and responds
↓
Audio response via WebRTC
↓
HTMLAudioElement playback (stays in browser pipeline)
↓
Browser AEC compares mic input + speaker output
↓
Echo automatically canceled (no feedback loop)
Why This Works
Browser Echo Cancellation Requirements:
Both microphone input AND speaker output must be in browser's audio graph
Audio must flow through browser's WebRTC stack
No manual intervention needed (browser handles it)
This is the industry standard:
ChatGPT voice mode
Google Meet
Zoom
Discord
Microsoft Teams
They ALL use always-on microphone + browser AEC.
DO NOT DO THESE THINGS
❌ DON'T: Toggle Microphone Track
// ❌ WRONG - This breaks echo cancellationasyncfunctionpauseRecording() {
microphone.enabled = false// DON'T DO THIS
}
asyncfunctionresumeRecording() {
microphone.enabled = true// DON'T DO THIS
}
Still doesn't prevent echo if implementation is wrong
What You CAN Change
✅ DO: Adjust Audio Settings
// ✅ Can tweak these settingsconst constraints = {
audio: {
echoCancellation: true, // MUST be truenoiseSuppression: true, // Can adjustautoGainControl: true, // Can adjustsampleRate: 24000, // Can change for qualitychannelCount: 1, // Mono is fine for voice
},
}
The WKWebView Problem (Historical):
Quetrex was originally a Tauri desktop app. On macOS, Tauri uses WKWebView, which has a bug: WebRTC audio playback doesn't work. This forced us to try workarounds (AudioWorklet bypass, native audio routing), which all broke echo cancellation.
Solution: Convert to web application. Now echo cancellation works perfectly everywhere.