# Ad Insertion

Ad insertion allows dynamically placing ads at specific points in a live audio stream. The stream is paused at a defined trigger point, ads are played, and the stream continues from the same point afterward. This process does not remove any part of the original stream but introduces a time shift.

## Stream Flow

`<-- Stream --- [StartBeepTrigger, Stream stops] Playing Ads (Insertion Zone xxxxx) [Stream continues where stopped] --- Stream <---`

## Requirements

**Insertion Trigger**

A trigger must be placed at the **exact moment** where the ad is to be inserted.

* **Frequency:** 18 Hz
* **Duration:** 1500 ms
* **Signal:** Phase-inverted on both left and right channels
* **Optional:** A flipped **copyright bit (**(Probably needs more adjustments, like no transcoding))

Once the trigger is detected, the stream is paused, and ad playback begins. When the ad(s) finish, the stream resumes from the exact point at which it was stopped.

## Stream Behavior

* The original stream is **not altered** — no audio frames are removed.
* Ads are inserted during a **temporary pause** in playback.
* After ad playback, the stream **resumes exactly** where it left off.
* The listener experiences a **delayed stream**, depending on ad length.
* You can configure a **maximum allowed delay** to control latency.

## Configuration in Console

**To configure ad insertion:**

1. Configure an **ad zone alias** for mid-rolls&#x20;
2. At the same place you can fine tune shifts/delays for the trigger in case this is needed.

***


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://audalaxy.gitbook.io/docs/ad-integration/ad-insertion.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
