an.audio.shared_mixing#
The fleet’s shared audio component, mixing, as an imports it.
mixing is a core dependency (an#611), so the way a part of it goes missing
is a mixing older than that part. mixing_too_old() is the one wording
of that failure, used around the lazy imports in an.audio.loudness
(mixing.loudness) and an.audio.effects (mixing.filtergraph). The
imports themselves stay written out where they are, so the licence firewall
(tests/test_captions.py::test_an_never_imports_mixing) still reads them.
A keyword an passes cannot be found by importing a name: an older function
takes the call and fails on it. lacks_keywords() asks the function’s
signature instead (level_group(subject=), mixing#171, an#765), and
mixing_problem() and an.audio.loudness word a missing one as a
mixing too old, like a missing part.
>>> with mixing_too_old(needed_for="testing", error=RuntimeError):
... from mixing import no_such_part
Traceback (most recent call last):
...
RuntimeError: testing needs mixing.no_such_part, which the installed mixing is too old to have: `pip install -U mixing`
A name missing from a module that exists is named in full:
>>> with mixing_too_old(needed_for="testing", error=RuntimeError):
... from mixing.loudness import no_such_name
Traceback (most recent call last):
...
RuntimeError: testing needs mixing.loudness.no_such_name, which the installed mixing is too old to have: `pip install -U mixing`
Module Attributes
The package, and what the user runs when theirs predates a part |
|
|
Functions
|
Why |
|
The |
Why the installed |
|
|
Run an import of a part of |
Say once per process, before anything is billed, that the installed |
Exceptions
The installed |
- an.audio.shared_mixing.INSTALL_HINT: str = 'pip install mixing'#
… and when it is not installed at all (an install with
--no-deps).
- an.audio.shared_mixing.LEVEL_GROUP_KEYWORDS: tuple[str, ...] = ('subject',)#
subjectnames the voice in itsGainCappedWarning(mixing#171, an#765).- Type:
The keywords
anpasses tomixing.loudness.level_group()
- an.audio.shared_mixing.MIXING: str = 'mixing'#
The package, and what the user runs when theirs predates a part
anneeds.
- exception an.audio.shared_mixing.MixingTooOldWarning[source]#
Bases:
UserWarningThe installed
mixinglacks a partanuses (or is absent).
- an.audio.shared_mixing.keywords_too_old(func, keywords, *, needed_for)[source]#
Why
func(a function ofmixing) cannot serveneeded_for: the keywords ofkeywordsit does not take, worded as amixingtoo old;Nonewhen it takes them all.>>> def level_group(segments, rate): ... >>> level_group.__module__ = "mixing.loudness" >>> keywords_too_old(level_group, ["subject"], needed_for="testing") 'testing needs mixing.loudness.level_group(subject=), which the installed mixing is too old to have: `pip install -U mixing`'
- an.audio.shared_mixing.lacks_keywords(func, keywords)[source]#
The
keywordsfuncdoes not take (none when it takes**kwargs, or when its signature cannot be read: the call then says for itself).>>> def old(segments, rate, *, target_lufs): ... >>> lacks_keywords(old, ["target_lufs", "subject"]) ['subject'] >>> lacks_keywords(lambda *a, **kw: None, ["subject"]) []
- an.audio.shared_mixing.mixing_problem()[source]#
Why the installed
mixingcannot servean: a part it uses is missing (mixing.loudnesswithgroup_lufsandGainCappedWarning, an#699;mixing.filtergraph), a keywordanpasses is not taken (level_group(subject=), an#765), or it is absent;Nonewhen it can. Asked of the code, not of a version number: an editable install’s metadata keeps the version it was installed at (an#644).
- an.audio.shared_mixing.mixing_too_old(*, needed_for, error)[source]#
Run an import of a part of
mixing; anImportErrorbecomeserror, saying the installedmixingis too old when it lacks the part, else what failed.
- an.audio.shared_mixing.warn_if_mixing_too_old()[source]#
Say once per process, before anything is billed, that the installed
mixingcannot servean(mixing_problem()): the entry points that may bill (a render,an voices design,auditionandreroll) call it, so an oldmixingis not found after synthesis (an#644).mixing_too_old()stays the backstop at each import.- Return type: