> For the complete documentation index, see [llms.txt](https://docs.trendswap.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trendswap.app/core-engine/audio-motion-sync.md).

# audio motion sync

In viral social content, **sound is 50% of the experience**. A video clip without its matching viral audio hook loses its viral potential.

TrendSwap features an end-to-end audio-motion synchronization pipeline that pairs every video frame with its exact musical and vocal counterpart.

***

## Synchronization Architecture

```
[ Template Master Audio ]
        |
        v
[ Waveform Beat Detection ] ---> Beat Markers (BPM Grid)
                                        |
                                        v
[ Neural Video Synthesis ]  ---> Frame Rate Alignment (24/30 fps)
                                        |
                                        v
[ AV Muxing & Drift Compensation ] ---> Perfectly Synced MP4 (<1ms error)
```

{% stepper %}
{% step %}

## Master Audio Stems

We utilize master reference audio tracks recorded and mastered specifically for high-impact social playback:

* High dynamic range optimized for smartphone speakers.
* Pre-leveled to standard broadcast loudness (-14 LUFS to -13 LUFS).
* Zero clipping or distortion on heavy bass drops.
  {% endstep %}

{% step %}

## Lip & Choreography Beat-Matching

For templates with vocal hooks (e.g., *Hit the Road Dude*'s dialogue or *Smalltown Boy*'s chorus screams):

* The character's jaw movement and facial gestures are temporally locked to the audio phoneme envelope.
* Climax cuts (such as camera rushes or lightning strikes) land precisely on downbeats.
  {% endstep %}

{% step %}

## Absolute Drift Compensation

During final MP4 container assembly, video PTS (Presentation Time Stamp) and audio PTS are aligned to sub-millisecond precision, guaranteeing that audio does not drift out of sync regardless of playback device.
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.trendswap.app/core-engine/audio-motion-sync.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
