Skip to content

Python API

All grading entry points are async and return a Report. The base import is light. Heavy dependencies load only when the feature that needs them runs.

import asyncio
from audel import check, listen

report = asyncio.run(check("promo.wav", spec="ebu_r128_s1"))

Grading

check async

check(source, *, settings: Settings | None = None, brief=None, spec=None) -> Report

Deterministically grade source; with brief, also grade transcript claims via the OFFLINE local ASR only. This path never constructs a network backend — no egress, ever.

spec is a :class:~audel.specs.DeliverySpec, a built-in name ("ebu_r128") or an operator JSON path; default is settings.delivery_spec (else the loudness preset).

listen async

listen(source, *, settings: Settings | None = None, spec=None, brief=None, script: str | None = None, required: list[str] | None = None, forbidden: list[str] | None = None, captions: str | None = None, languages: dict[int, str] | None = None, key_messages: list[str] | None = None, tone: str | None = None, understand: bool = False, backend: str | None = None) -> Report

Hear and listen to source. Returns one Report: the hearing findings, the listening findings, and report.listening with the measurements behind them.

Without understand this never touches the network. With it, egress goes ONLY to backend (default: ollama-local when AUDEL_LOCAL_LLM_URL is set, else the configured audio_backend).

analyze async

analyze(source, *, settings: Settings | None = None, brief=None, backend=None, spec=None) -> Report

Full grade of source; with a brief, grades deterministic + LLM/CLAP requirements.

watch async

watch(source, *, settings: Settings | None = None, frames: int | None = None, interval_ms: int | None = None, click_selector: str | None = None) -> Report

Temporal grade of source (file OR http(s) URL). frames/interval_ms clamped (DoS).

render async

render(source, *, settings: Settings | None = None, spec: DeliverySpec | str | None = None) -> RenderResult

Decode source to a RenderResult. Async wrapper over the bounded ffmpeg work.

Delivery specs

DeliverySpec

Bases: BaseModel

builtin_spec

builtin_spec(name: str) -> DeliverySpec

A built-in spec by NAME only (the safe surface for remote callers).

resolve_spec

resolve_spec(value: str | DeliverySpec | None) -> DeliverySpec | None

Name → built-in; a path ending in .json → file; a DeliverySpec passes through.

Report

Report

Bases: ReportBase

An audio report: shared fields + the decode/grading-specific surface.

TrackSummary

Bases: BaseModel

Per-audio-stream measurements, flat and JSON-safe (non-finite levels become None).

ListeningSummary

Bases: BaseModel

The listening layer: what was said and how well it can be followed.

Configuration

load_settings

load_settings(**overrides) -> Settings

Build a Settings object, applying any explicit overrides last.

An env file is read only when AUDEL_ENV_FILE names one explicitly.