Switch to sounddevice recording

This commit is contained in:
Thales Maciel 2026-02-24 10:25:21 -03:00
parent afdf088d17
commit b6c0fc0793
No known key found for this signature in database
GPG key ID: 33112E6833C34679
9 changed files with 250 additions and 468 deletions

View file

@ -5,12 +5,13 @@ Python X11 transcription daemon that records audio, runs Whisper, logs the trans
## Requirements
- X11 (not Wayland)
- `ffmpeg`
- `sounddevice` (PortAudio)
- `soundfile` (libsndfile)
- `faster-whisper`
- `pactl` (PulseAudio utilities for mic selection)
- Tray icon deps: `gtk3`
- i3 window manager (focus metadata via i3 IPC)
- Python deps: `pillow`, `python-xlib`, `faster-whisper`, `PyGObject`, `i3ipc`
- Python deps: `pillow`, `python-xlib`, `faster-whisper`, `PyGObject`, `i3ipc`, `sounddevice`, `soundfile`
System packages (example names): `portaudio`/`libportaudio2` and `libsndfile`.
## Python Daemon
@ -39,7 +40,7 @@ Create `~/.config/lel/config.json`:
```json
{
"daemon": { "hotkey": "Cmd+m" },
"recording": { "input": "pulse:default" },
"recording": { "input": "0" },
"transcribing": { "model": "base", "device": "cpu" },
"injection": { "backend": "clipboard" },
@ -56,11 +57,14 @@ Create `~/.config/lel/config.json`:
Env overrides:
- `WHISPER_MODEL`, `WHISPER_DEVICE`
- `WHISPER_FFMPEG_IN`
- `WHISPER_FFMPEG_IN` (device index or name)
- `LEL_HOTKEY`, `LEL_INJECTION_BACKEND`
- `LEL_AI_CLEANUP_ENABLED`, `LEL_AI_CLEANUP_MODEL`, `LEL_AI_CLEANUP_TEMPERATURE`
- `LEL_AI_CLEANUP_BASE_URL`, `LEL_AI_CLEANUP_API_KEY`
Recording input can be a device index (preferred) or a substring of the device
name. Use the settings window to list available input devices.
## systemd user service
```bash