diff --git a/backend/services/audio_io.py b/backend/services/audio_io.py index c57ce2d3..58ce1904 100644 --- a/backend/services/audio_io.py +++ b/backend/services/audio_io.py @@ -206,7 +206,7 @@ def _safe_torchaudio_save( torchaudio.save(path_or_buf, tensor, sample_rate, format=fmt) except (ImportError, RuntimeError) as e: if isinstance(e, RuntimeError) and "could not load libtorchcodec" not in str(e).lower(): - raise # Unrelated encoder failures must remain visible. + raise _describe_write_failure(e, path_or_buf) from e # torchaudio >= 2.9 routes save() through TorchCodec, which needs # FFmpeg *shared libraries* on the system. Where those are absent the # write raises ImportError and every generation fails. #1931 guarded