Add configurable core audio effects and audition workflow - #11
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The audition renderer can hit a later KeyError if the planner returns an unexpected render-task count, and it should fail fast with a clear validation error at task collection time.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR introduces a backend-neutral “core effects” layer for post-synthesis audio processing (fade/telephone/monster/censor/glitch), makes effect chains configurable via TOML, integrates effect rendering into the main pipeline and audition workflow, and records effect provenance/audits alongside existing build artifacts.
Changes:
- Add
lessons_in_cast_core.effects(library + processor + CLI) with validated presets/chains and deterministic ordered rendering. - Integrate effect application/audit emission into
WaveRendererandPipeline.synthesize, plus consolidatedaudio_effects.jsonlretention. - Update audition rendering to support “effect-only” cases and to preserve raw (dry) takes separately from effected outputs; update configs/docs/tests accordingly.
File summaries
| File | Description |
|---|---|
| tests/test_pipeline.py | Extends end-to-end pipeline test to request an effect and verify audio_effects.jsonl retention across intermediate cleanup. |
| tests/test_emotion_preparation.py | Ensures pipeline config loading works in tests by providing an effects configuration alongside custom emotions. |
| tests/test_effects.py | Adds unit/integration coverage for core effects, config validation, determinism, and Opus/RPA delivery integration. |
| tests/test_audition.py | Adds audition tests for post-profile effect application, raw take preservation, and effect-only (no TTS) behavior. |
| src/lessons_in_cast_core/workflow/artifacts.py | Adds audio_effects artifact path and includes it in generated artifact reset. |
| src/lessons_in_cast_core/synthesis/audio.py | Applies effects in WaveRenderer, maps EffectError to AudioRenderError, and writes/cleans .effects.json audits per output. |
| src/lessons_in_cast_core/pipeline.py | Wires configured effect processor into the renderer, records effects config in the run manifest, and consolidates per-dialogue effect audits into audio_effects.jsonl. |
| src/lessons_in_cast_core/effects/processor.py | Implements ordered, backend-independent effect execution and provenance reporting (core PCM + FFmpeg where needed). |
| src/lessons_in_cast_core/effects/pcm.py | Introduces dependency-free PCM helpers (read/write, fades, edge-windowing). |
| src/lessons_in_cast_core/effects/cli.py | Adds lessons-in-cast-effects CLI for listing, rendering, and audition comparisons. |
| src/lessons_in_cast_core/effects/catalog.py | Adds validated effect specs, defaults, configurable presets, and deterministic chain expansion. |
| src/lessons_in_cast_core/effects/main.py | Enables python -m lessons_in_cast_core.effects entrypoint. |
| src/lessons_in_cast_core/effects/init.py | Exposes the public effects API surface. |
| src/lessons_in_cast_core/config.py | Loads [effects] configuration into PipelineConfig with explicit validation/errors. |
| src/lessons_in_cast_core/audition/rendering.py | Updates auditions to support effects, preserve raw takes, and include effects config in audition fingerprinting. |
| README.md | Updates roadmap/status to reflect initial effects implementation and pending listening acceptance. |
| pyproject.toml | Registers the new lessons-in-cast-effects console script entry point. |
| docs/effects.md | Documents effect contract, configuration, limitations, CLI usage, and artifact/audit behavior. |
| configs/pipeline.toml | Replaces placeholder effect allowlist with implemented effects and points to configs/effects.toml. |
| configs/effects.toml | Adds default preset overrides and a sample chain (fractured_entity). |
| auditions/effects/project.toml | Adds a reusable audition fixture for comparing preset/chain outputs against dry input. |
Review details
- Files reviewed: 21/21 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if planned.render_tasks: | ||
| tasks[target_id] = planned.render_tasks[0] |
Summary
Closes #1.
configs/effects.toml, with explicit validation and errors rather than silently dropping unsupported effects.Validation
PATH=/path/to/ffmpeg/bin:$PATH PYTHONPATH=src python -m unittest discover -s tests -t . -qin the project Conda environment.build/auditions/core-effects-v1/.auditions/effects/project.toml. Reproduce usingPYTHONPATH=src python -m lessons_in_cast_core.effects --config configs/effects.toml audition --input PATH_TO_DRY_WAV --run NEW_RUN_NAME.Review notes
Listening acceptance is still pending. Glitch uses granular freezing rather than automatic phoneme alignment; choose a voiced fragment for a sustained-vowel impression. Monster tempo compensation is approximate, and telephone processing is stylized rather than an exact telecom codec. Censor intervals are time-based; raw build audio remains available, so this is not a secure-redaction feature.
The workspace allowlist now uses implemented effects instead of the former unimplemented chorus/distortion/echo/reverb placeholders. This change does not include the separate IndexTTS punctuation fix in PR #10.
Do not merge automatically. The repository's delete-branch-on-merge setting should remove this branch after the PR is reviewed and merged.