.
This commit is contained in:
@@ -67,11 +67,13 @@ class FillerAudioLibrary:
|
||||
{key: len(value) for key, value in self._clips.items()},
|
||||
)
|
||||
|
||||
def pick(self, key: str | None = None) -> bytes | None:
|
||||
def pick(self, key: str | None = None, *, allow_fallback: bool = True) -> bytes | None:
|
||||
if not self._enabled:
|
||||
return None
|
||||
normalized_key = (key or "").strip().lower() or "generic"
|
||||
candidates = self._clips.get(normalized_key) or self._clips.get("generic") or []
|
||||
candidates = self._clips.get(normalized_key) or []
|
||||
if not candidates and allow_fallback:
|
||||
candidates = self._clips.get("generic") or []
|
||||
if not candidates:
|
||||
LOGGER.info("filler audio pick missed: key=%s available=%s", normalized_key, list(self._clips))
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user