Insert a mid-roll ad into a podcast: Timeline audio split, concat

Split the episode at the break with two ranges, then concat part one, the ad read and part two. Two $0.01 jobs; all parts need the same channel layout.

4 min readSume
All posts

Run POST /v1/timeline-1.0/audio as a split with two ranges at the break point, then as a concat of the first half, your ad read and the second half. That is two jobs at $0.01 each. All concat parts must share a channel layout, or the worker fails with audio_parts_channel_mismatch.

Job 1: split at the break

Split takes a top-level url and ranges[] of up to 20 entries, and no parts. For a break at 12:30, use 750 seconds.

{
  "operation": "split",
  "url": "https://media.sume.com/artifacts/artf_demo/episode.wav",
  "ranges": [{ "start": 0, "end": 750 }, { "start": 750 }]
}

Job 2: concat the three pieces

Take segments[0].audio_url and segments[1].audio_url from the split result, plus the ad read as a Sume-hosted file. Send them as parts[] in order. Both jobs need an Idempotency-Key header, and the audio must be on this workspace's media.sume.com.

Mid-roll insertion cost and rules (read 2026-10-03)
ItemValue
Split job$0.01 flat
Concat job$0.01 flat
Parts per concat1 to 20
Output formatwav by default; mp3 optional
Produced audio limit1,800 seconds

The channel catch

An episode is often stereo and a generated ad read may be mono. Mixing them fails the concat. Detach or re-export so both share one layout, and keep wav through the chain, because mp3 re-adds priming padding at every edge and can leave small gaps at the seams. The produced file can be at most 1,800 seconds, which limits this recipe to 30-minute episodes.

Sources

Related posts

More in Use cases

All Use cases posts

Written by Sume