handle AIC processor init errors gracefully and ensure _aic_ready reflects readiness

This commit is contained in:
Gökmen Görgen
2026-01-27 11:28:05 +01:00
parent ca2eb1904f
commit 81a53c699c

View File

@@ -189,10 +189,15 @@ class AICFilter(BaseAudioFilter):
# Create async processor
try:
self._processor = ProcessorAsync(self._model, self._license_key, config)
self._aic_ready = True
except Exception as e: # noqa: BLE001 - surfacing SDK initialization errors
logger.error(f"AIC model initialization failed: {e}")
self._aic_ready = False
self._processor = None
self._aic_ready = self._processor is not None
if not self._aic_ready:
logger.debug(f"ai-coustics filter is not ready.")
return
# Get contexts for parameter control and VAD
self._processor_ctx = self._processor.get_processor_context()