Mixing an extra audio track into a video with a custom mixing effect

Play the video.

This demo shows a Javascript worker applying a custom effect to mix an overlay audio track into a video. This filter applies a ducking effect to make the video's track fade out while the overlay track has sound.

Note that A/V sync is maintained even though this filter necessarily has a latency of more than one second (so we can start reducing the audio of the main track before sound becomes active on the overlay track). As always, pausing and resuming playback does not disrupt the processing.