Module f-audio-sync · Video · 8 min

Audio sync
in video.

Lip-sync, beat-cut, the patterns underneath the AI Music Idols pipeline.

Reading time8 min Audio- Prerequisitesf-video-diff SourceTrack A · Gemini
§ 1

What this lesson covers.

This module is one of 42 in the curriculum. Below is the canonical interactive lesson — tabs, cards, and diagrams from the source repo, rendered inside the course shell. There is no audio narration for this module - it ships as text + interactive lesson only.

If you prefer to read first and play with the demos after, the interactive lesson sits below this section. If you'd rather hear it narrated while you scroll, hit play on the sticky audio bar at the top — or just let it autoplay.

Read / reason / test

A timestamp is not an accuracy guarantee

High school · build the intuition

Captions, narration and video share a timeline but can use different units. Valid timestamps can still display words too early, remove them too quickly or split a phrase awkwardly. Alignment, caption readability and mouth-motion matching are separate questions. Review the actual media rather than inferring quality from the number of decimal places in a timestamp.

College · work the example

At 24 frames per second, one frame spans about 41.67 milliseconds. Time 1.5 seconds corresponds to frame 36 when indexed from zero. Frame-boundary rounding is quantization, not the same thing as alignment error. State whether a timestamp refers to frame starts, audio samples or subtitle intervals before comparing offsets across tools.

Explain it back

Describe the process in your own words. Identify the assumption that makes this example work, then explain one conclusion it cannot establish.

Read the primary source or official documentation →

The numerical examples are authored teaching exercises, not measured model benchmarks. This extension adds context to the original lesson.

§ 2

The lesson itself.

Interactive lesson · ported from Gemini track Click tabs to navigate · hover cards for details
Video · Audio

Audio Sync in Video

Lip-sync · beat-cut · the patterns underneath the AI Music Idols pipeline

TWO PROBLEMS, ONE TIMELINE

Pre-existing audio drives the video vs vice versa

Two distinct workflows. (A) Audio-driven: you already have music/dialogue and need video synchronized to it. Lock the audio's beat-grid or speech-phoneme-grid, generate visuals on that timeline. (B) Video-driven: you have visuals first, need a soundtrack/dialogue laid over them. Generate or compose audio against the cut. The AI Music Idols pipeline uses (A) almost exclusively — audio is the immovable spine.
LIP-SYNC

Phoneme alignment to mouth movements

Lip-sync requires (1) speech-to-phoneme alignment with timestamps, (2) a mouth-region generator (Wav2Lip and successors) that takes a face image + audio and produces synchronized mouth animation. Modern systems (SadTalker, MuseTalk) extend this to head pose and expression. For full character animation, audio drives a 3D rig or 2D facial landmark sequence.
BEAT-CUT

Music informs the editing pace

Detect beats and energy peaks in the audio (librosa beat_track or Essentia). Use the beat positions as cut points. For a 120 BPM song, that's a potential cut every 0.5s. Don't cut on every beat — usually every 4-8 beats. Energy peaks (drops, builds) become longer holds. Macalinao Studio idol pipeline uses this to drive 90% of the cut decisions automatically.
SYNC AS DELIVERABLE

Treat the locked audio + video edit as the primary artifact

Ship the timeline (a JSON of "audio at 0:00, cut at 0:08.3, ...") alongside the rendered MP4. This makes regeneration easy: if a single shot needs reshooting, you don't lose the audio sync. It also makes the workflow inspectable — you can see why a cut landed where it did.
§ PAPERS

Further reading.

The canonical references for this module. External links open in a new tab.

§ NEXT

What to read next.

Use the pager below to move sequentially through the curriculum, or jump to any module from the course index. Each track has a "Prereq: ↑ foundation" callout so you can backfill anything that wasn't clear.