Skip to main content
Version: develop (unreleased)

renderer/remotion/sound-tools/tests

Covers the sound-effects engine, renderer/remotion/sound-tools/sfx_mix.py, which mixes bank sounds under a video's voice at submit_render (Sound effects). The cues it is given come from tubematic_core/sound.py, which tubematic-core.md covers. The suite needs numpy, soundfile and the earshot bank (Sound effects engine says how to install them). Without them every test is skipped. CI installs them.

python -m pytest renderer/remotion/sound-tools/tests

test_sfx_mix.py​

Runs the engine on a synthetic voice: tone bursts with silences, at a known speech level.

  • Each effect's loudest 50 ms sits within 1 dB of its cue's level from the voice's median speech level, below it and above it (the current role levels), the measure the owner approved by ear. A level wrong by several dB would make every effect too loud or inaudible, and nothing else would notice.
  • Where a loud voice and an effect together pass -1 dBFS, only the excess is softened, and the voice where no effect plays comes out sample for sample unchanged. The voice is never turned down.
  • The command writes mix.wav as long as the voice to the sample, at 48 kHz stereo, and a cue sheet that lists every cue. The renderer plays the mix in the voice's place, so a longer or shorter file would move every caption against the narration.

Needs: numpy, soundfile and the earshot bank. numba makes the bank about fifteen times faster and is not required.