Microphone Issues
Klaus not detecting my microphone
Klaus not detecting my microphone
> indicates the system default device.To select a specific microphone:Edit ~/.klaus/config.toml:config.py:38, device_catalog.pyMicrophone level too low
Microphone level too low
-
Increase system mic level:
- macOS: System Settings > Sound > Input > Input volume
- Windows: Settings > System > Sound > Input device > Device properties > Volume
-
Adjust VAD RMS threshold if your mic is inherently quiet:
- Use push-to-talk mode instead of voice activation to bypass VAD filtering
audio.py:404-412How do I switch microphones mid-session?
How do I switch microphones mid-session?
- Click the settings button (gear icon)
- Go to the “Microphone” tab
- Select a different mic from the dropdown
- Changes apply immediately (VAD stream restarts with new device)
~/.klaus/config.toml.Reference: main.py:856-867, settings_dialog.py, device_switch.pyAudio input status warnings in logs
Audio input status warnings in logs
sounddevice callback status flag:- Input overflow: Audio buffer overrun (frames dropped)
- Input underflow: Not enough data available
- Close other audio-intensive applications
- Check CPU usage
- Try a different USB port for USB microphones
audio.py:72-73, audio.py:284-286Voice Activation (VAD) Issues
VAD not detecting my speech
VAD not detecting my speech
- Klaus stays in “Idle” state when you speak
- Log shows:
VAD: discarding low-voice utterance
-
Lower VAD sensitivity (0-3, lower = less aggressive filtering):
-
Reduce minimum thresholds:
- Check microphone level (see “Microphone level too low” above)
- Use push-to-talk mode as a workaround
audio.py:105-131, config.py:62-80VAD triggering on background noise
VAD triggering on background noise
- Klaus enters “Listening” state when no one is speaking
- Fan noise, keyboard typing, or room noise triggers VAD
-
Increase VAD sensitivity:
-
Increase minimum thresholds:
-
Reduce room noise:
- Use a directional microphone
- Enable noise cancellation in system settings (if available)
- Move away from fans, HVAC vents, mechanical keyboards
audio.py:363-415Understanding VAD discard reasons
Understanding VAD discard reasons
| Reason | Meaning | Fix |
|---|---|---|
vad_short_duration | Utterance < vad_min_duration | Lower vad_min_duration |
vad_low_voiced_frames | Fewer than vad_min_voiced_frames | Lower vad_min_voiced_frames |
vad_low_voiced_ratio | Voiced ratio < vad_min_voiced_ratio | Lower vad_min_voiced_ratio |
quality_short_voiced_run | Max contiguous run < vad_min_voiced_run_frames | Lower vad_min_voiced_run_frames |
quality_low_rms | Loudness < vad_min_rms_dbfs | Lower vad_min_rms_dbfs or increase mic level |
audio.py:363-415, main.py:418-432VAD silence timeout too short/long
VAD silence timeout too short/long
config.py:64, audio.py:126Push-to-Talk Issues
Push-to-talk not recording
Push-to-talk not recording
- Press and hold F2 (or configured hotkey), but Klaus stays in “Idle”
- Release key, no transcription appears
- Global hotkey not working (see macOS Permissions)
- Wrong input mode - Klaus is in voice-activation mode
- Microphone not accessible
-
Verify input mode:
- Check status widget shows “Push-to-Talk”
- Toggle mode with
toggle_keyor mode button
-
Use in-app hotkey if global hotkey fails:
- Focus Klaus window
- Press and hold configured key
-
Check logs:
Expected output:
main.py:734-759, audio.py:36-99Recording stopped (no audio captured)
Recording stopped (no audio captured)
audio.py:77-95Text-to-Speech (TTS) Issues
No audio output when Klaus speaks
No audio output when Klaus speaks
- Klaus transitions to “Speaking” state
- No audio plays
- Logs show TTS generation but no playback errors
- System output muted - Check system volume
- Wrong output device selected - Klaus uses system default
- Audio device in use - Close other apps using audio output
-
Check system audio:
- Ensure volume not muted
- Play a test sound from system settings
-
Verify default output device:
Look for the device marked with
>(default output). -
Test TTS independently:
- Click replay button on a previous response in chat
- If replay works, the issue is with live synthesis
tts.py, audio.py:452-486TTS playback crackling or stuttering (macOS)
TTS playback crackling or stuttering (macOS)
sd.OutputStream to avoid CoreAudio latency.The VAD mic stream is suspended during TTS playback to free the audio device.If crackling persists:-
Check sample rate mismatch:
- TTS output is 24000 Hz
- Ensure output device supports 24 kHz or has good resampling
-
Close competing audio apps:
- DAWs, music production software, voice chat apps
-
Increase TTS latency (code change required):
- Klaus uses
latency='high'on macOS by default - Further tuning requires editing
tts.py
- Klaus uses
tts.py, audio.py:245-276TTS voice or speed settings not applying
TTS voice or speed settings not applying
~/.klaus/config.toml:config.py:50-55, config.py:192-196TTS cuts off mid-sentence
TTS cuts off mid-sentence
- User interrupted - Pressed stop button or started speaking (in voice-activation mode)
- Network error - OpenAI TTS API timeout or connection lost
- Audio device disconnected
- “Stop requested via UI” - User clicked stop
- API error messages - Network or OpenAI issues
main.py:833-837, tts.pySpeech-to-Text (STT) Issues
Transcription is inaccurate
Transcription is inaccurate
medium (245M params, ~300ms latency)To improve accuracy, use a larger model:Edit ~/.klaus/config.toml:tiny: Fastest, least accuratesmall: Balancedmedium: Slower, most accurate
~/.cache/moonshine/.Reference: config.py:83-86, stt.py, README.md:9STT language not recognized
STT language not recognized
en (English)To change language:config.py:85STT processing is slow
STT processing is slow
medium modelIf slower:-
Use smaller model:
- Close CPU-intensive apps to free resources
-
Check CPU usage during transcription:
- Activity Monitor (macOS)
- Task Manager (Windows)
README.md:9, stt.pyAudio Device Switching
Live microphone switch failed
Live microphone switch failed
- New mic in use by another app
- New mic requires driver not installed
- Invalid device index
- Close apps using the mic
- Reconnect the mic
- Select a different mic from the list
device_switch.py, main.py:856-867VAD stream suspend/resume errors
VAD stream suspend/resume errors
- USB mic disconnected
- System switched default device
- Mic claimed by another app
- Klaus logs the error but continues
- Reconnect the mic
- Toggle input mode (switches to PTT and back) to reinitialize VAD
audio.py:245-276Advanced Audio Debugging
sounddevice backend issues
sounddevice backend issues
sounddevice which wraps PortAudio.On macOS: Core Audio backend
On Windows: WASAPI backend
On Linux: ALSA backendTo debug backend issues:- Sample rate mismatch: Ensure device supports 16 kHz (mic) and 24 kHz (speaker)
- Exclusive mode: Close apps with exclusive audio access
- ASIO drivers (Windows): Not supported by Klaus; use WASAPI-compatible devices
audio.pyEnable debug-level audio logs
Enable debug-level audio logs
~/.klaus/config.toml:- VAD frame-by-frame voiced/unvoiced decisions
- RMS levels
- Discard reasons
- Stream lifecycle events
config.py:115-117