Files
voculinux/src/vocalinux/audio/errors.py
T
xavierk 71b97fe633
CI / security (pull_request) Successful in 1m10s
CI / lint (pull_request) Successful in 23s
CI / ai-review (pull_request) Successful in 25s
fix(audio): never record from another microphone when one is configured
A configured device that was virtual, output-only, renamed or unplugged
was replaced by the hardware default input, with only a log warning. The
capture source now refuses an explicit selection that cannot be used as
configured: it raises AudioDeviceUnavailableError, skips reconnection
(retrying cannot help), and reports it through the desktop notification
path. System Default (unset, or -1) keeps its implicit default.

Behaviour change: an unplugged or renamed configured microphone now fails
visibly instead of recording from the default input. Pulse source
selection is unchanged.

Fixes #42
2026-11-06 23:58:15 +05:30

15 lines
510 B
Python

"""Errors shared by microphone and system-audio capture sources."""
class CaptureStalledError(IOError):
"""The capture device stopped delivering audio frames."""
class AudioDeviceUnavailableError(IOError):
"""The configured capture device cannot be used as configured.
Raised instead of recording from another input: a configured device that
is missing, renamed, virtual or output-only must fail visibly (issue #42).
The message is user-facing and names the configured device.
"""