From 665279f7cd1cc2c0b7ff77c9af55ac2437693e39 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Mon, 21 Sep 2026 20:05:11 -0700 Subject: feat: move to virtual sink and loopback audio device as default method - creates a virtual audio sink on startup and a loopback - enables listening on loopback - provide finegrain control over what you want the AI to hear --- gui/gui_settings.py | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'gui/gui_settings.py') diff --git a/gui/gui_settings.py b/gui/gui_settings.py index 2956b0e..6ac0763 100644 --- a/gui/gui_settings.py +++ b/gui/gui_settings.py @@ -67,10 +67,17 @@ class _SettingsDialog(QDialog): whisper_layout = QFormLayout() whisper_layout.setLabelAlignment(Qt.AlignmentFlag.AlignLeft) - device_options = [ - f"[{idx}] {dev['name']} ({dev.get('max_input_channels', 0)} ch)" - for idx, dev in input_devices - ] + def _format_device_option(idx: int, dev: Dict[str, Any]) -> str: + name = str(dev.get("name", "")) + lowered = name.lower() + virtual_hint = "" + if "auto_live_tl_input" in lowered or "auto-live-tl-virtual-input" in lowered: + virtual_hint = " [virtual input]" + elif "auto_live_tl_sink" in lowered or "auto-live-tl-virtual-sink" in lowered: + virtual_hint = " [virtual sink monitor]" + return f"[{idx}] {name}{virtual_hint} ({dev.get('max_input_channels', 0)} ch)" + + device_options = [_format_device_option(idx, dev) for idx, dev in input_devices] self.device_combo = QComboBox(whisper_tab) self.device_combo.addItems(device_options) self.device_combo.setEditable(False) @@ -78,7 +85,16 @@ class _SettingsDialog(QDialog): if default_device_name in self.device_names: self.device_combo.setCurrentIndex(self.device_names.index(default_device_name)) else: - self.device_combo.setCurrentIndex(0) + preferred_index = -1 + for i, name in enumerate(self.device_names): + lowered = str(name).lower() + if "auto-live-tl-virtual-input" in lowered or "auto_live_tl_input" in lowered: + preferred_index = i + break + if preferred_index >= 0: + self.device_combo.setCurrentIndex(preferred_index) + else: + self.device_combo.setCurrentIndex(0) whisper_layout.addRow(QLabel("Audio input device:"), self.device_combo) self.model_combo = QComboBox(whisper_tab) @@ -348,6 +364,9 @@ class _SettingsDialog(QDialog): return device_index = self.device_indices[selection] + if device_index < 0: + self._monitor_error = "Live monitor preview is unavailable for PipeWire direct input." + return try: device_info = sd.query_devices(device_index) except Exception as exc: -- cgit v1.2.3