Input Device Selection
Choose which microphone or audio input device to use for voice recording.Select input device
Choose your microphone from the “Input Device” dropdownThe list shows all available input devices detected by sounddevice
Input Device Configuration
Frompreferences.py:37:
audio_utils.py:16):
Output Device Selection
Choose which speakers or audio output device to use for TTS playback.The output device selection is primarily informational. ChatbotAI-Free uses PipeWire (via paplay) for playback, which automatically handles device routing and mixing.
Output Device Configuration
Frompreferences.py:36:
PipeWire Integration
ChatbotAI-Free uses PipeWire for audio output to avoid exclusive ALSA device locking and enable simultaneous playback with other apps (YouTube, music players, etc.).How PipeWire Playback Works
Fromaudio_utils.py:183-291:
Fallback to sounddevice
Ifpaplay is not installed, the app automatically falls back to sounddevice:
Sample Rate Settings
ChatbotAI-Free uses different sample rates for different stages of audio processing:Input (Speech Recognition)
- Target sample rate: 16000 Hz (optimized for Whisper STT)
- Automatic resampling: If your microphone’s native rate differs, audio is resampled
audio_utils.py:56-63:
audio_utils.py:165-170):
Output (TTS Playback)
- Kokoro TTS: 24000 Hz
- Sherpa-ONNX: 22050 Hz (most Piper models)
Troubleshooting Audio Issues
No microphone detected
Check device permissions
Check device permissions
Ensure your OS has granted microphone access to the Python process. On Linux, check PipeWire/PulseAudio permissions.
List available devices
List available devices
Run this Python snippet to see all detected devices:Look for devices with
max_input_channels > 0.Audio cuts out or stutters
Increase buffer size
Increase buffer size
The default blocksize is 1024 samples. For some devices, increasing to 2048 may help:Edit
audio_utils.py:70:Check CPU usage
Check CPU usage
If your CPU is overloaded, try:
- Using a smaller Whisper model (
baseinstead oflarge-v3) - Closing other applications
- Disabling GPU acceleration if it’s causing thermal throttling
TTS playback conflicts with other apps
Install PipeWire and paplay
Install PipeWire and paplay
This is the most common cause. Install PipeWire audio:Ubuntu/Debian:Fedora:Arch Linux:
Check paplay installation
Check paplay installation
Verify paplay is available:If not found, the app will fall back to sounddevice, which may lock the audio device.
Recording picks up TTS output (feedback loop)
Use headphones
Use headphones
The simplest solution is to wear headphones so the microphone doesn’t pick up speaker output.
Automatic pause during playback
Automatic pause during playback
ChatbotAI-Free automatically pauses recording while TTS is playing (see
audio_utils.py:85-98):Voice Activity Detection too sensitive
Adjust silence threshold
Adjust silence threshold
The default RMS threshold is
0.03 to filter background noise. If it’s too sensitive:Edit audio_utils.py:21:Adjust silence duration
Adjust silence duration
The default is 3 seconds of silence before stopping. To make it shorter or longer:Edit
audio_utils.py:27:Audio Quality Settings
Recording Quality
- Format: float32 PCM
- Channels: Mono (1 channel)
- Sample rate: 16000 Hz (after resampling)
- Bit depth: 32-bit float during processing
Playback Quality
- Format: int16 PCM (for WAV file compatibility)
- Channels: Mono (1 channel)
- Sample rate: 22050 Hz (Sherpa) or 24000 Hz (Kokoro)
- Bit depth: 16-bit for file output