renderer/remotion/cartoon-tools/audio/tests
Covers the soundtrack engine of a Cartoon 3D video: the Python code under
renderer/remotion/cartoon-tools/audio/ that synthesises music and sound effects from a spec and
mixes them under the voice. The MCP tool
cartoon_soundtrack runs it, and
The Cartoon 3D kit says where it sits in the
Remotion project. The suite needs numpy and scipy, which mcp/requirements.txt installs. Without
them every test is skipped.
python -m pytest renderer/remotion/cartoon-tools/audio/tests
The mixer
test_mix_rules.py
Covers cues.py::Cue, and mix.py run as a command on a synthetic voice, a timeline and a spec.
- An event is placed at the level its
naivevalue asks for, measured against the voice.cues.SFX_DBis 0 and a bed keeps its level too. - The music is ducked under an event for the event's length. The test renders one score with and without a loud hit and compares the music stem at that moment.
- The cue sheet (
cues.md) gives every event its level over the music, andloudness.jsoncounts the events that sit under the music (events_under_music). - An event louder than the voice minus 4 LU counts in
events_too_loud, and a music section set above -14 LU is listed insections_too_loud. Both show on the cue sheet, because an effect as loud as the voice drowns the narration and the skill treats either as a fix. - A music section that names no level gets one inside the guidance's quiet range.
- An event in the last 200 ms of the mix is measured like any other.
Trap: SFX_DB is a fixed offset added to every event, and it must stay 0. A negative offset puts
every effect below the level the spec asks for and under the band. The author reads the spec and
the cue sheet and cannot see such an offset.
Needs: numpy and scipy. The second test runs mix.py twice as a subprocess and synthesises real
audio.