AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

Automating Multitrack Podcast Cleanup with the Cleanvoice REST API and Webhooks

Betsy Paoletta · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Digital media studios, syndicated podcast networks, and programmatic audio pipelines processing dozens of weekly episodes inevitably hit a ceiling with browser-based editing interfaces. Manually uploading multi-mic interview stems through a web dashboard introduces operational latency, human error, inconsistent loudness leveling, and an inability to pipe cleaned masters directly into content management systems (CMS) or audio distribution networks.

At 365Finds, our research into programmatic audio infrastructure indicates that the Cleanvoice REST API (/v2/edits) paired with asynchronous webhook workers offers one of the most reliable architectures for hands-off podcast post-production. However, automating multitrack cleanup introduces distinct engineering challenges: maintaining phase synchronization across microphone tracks, tuning AI detection thresholds to avoid conversational clipping, managing long-running asynchronous jobs without hitting rate limits, and ingesting generated transcripts into downstream publishing pipelines.

This technical guide demonstrates how podcast automation engineers can configure, trigger, and consume Cleanvoice multitrack cleaning jobs at scale, with production-ready payload templates, asynchronous webhook handling, and asset pipeline integration.


1. Architectural Overview: Multitrack Ingestion to Webhook Delivery

A robust podcast automation pipeline shifts the entire burden of speech cleaning—filler removal, lip-smack de-clicking, breath softening, cross-talk gating, and loudness normalization—from sound engineers to background workers.

+-----------------------------------------------------------------------------------+
|                            Podcast Production Pipeline                            |
+-----------------------------------------------------------------------------------+
                                          |
  [Raw Audio Sources]                     v
  Host Mic (WAV)       ----+   +------------------------------------+
  Guest 1 Mic (WAV)    ----+----> S3 / Cloudflare R2 Ingestion Bucket
  Guest 2 Mic (WAV)    ----+   +------------------------------------+
                                          |
                                          v
                               +---------------------+
                               | Orchestration Engine|
                               | (FastAPI / Celery / |
                               | Node.js / Lambda)   |
                               +---------------------+
                                          |
                           POST /v2/edits (upload_type: multitrack)
                                          |
                                          v
                               +---------------------+
                               |   Cleanvoice API    |
                               |   Worker Cluster    |
                               +---------------------+
                                          |
               Job Lifecycle: PENDING -> EDITING -> EXPORT -> SUCCESS
                                          |
                                          v
                   +-----------------------------------------------+
                   | Event Dispatcher / Webhook Handler            |
                   | (Direct S3 signed_url PUT or Webhook Callback)|
                   +-----------------------------------------------+
                                          |
                      +-------------------+-------------------+
                      |                                       |
                      v                                       v
          +-----------------------+               +-----------------------+
          | Cleaned Multitrack /  |               | Whisper Transcription |
          | Merged Master (WAV)   |               | & JSON Show Notes     |
          +-----------------------+               +-----------------------+
                      |                                       |
                      v                                       v
             DAW Stems / Libsyn /                     VTT / SRT Captions &
             Spotify for Podcasters                   CMS Show Notes Post

Key Lifecycle Phases

When a job is dispatched to Cleanvoice, it traverses several internal state transitions:

  1. PENDING / STARTED: Job queued in the processing cluster.
  2. PREPROCESSING: Audio validation, format decoding, sample-rate matching.
  3. CLASSIFICATION: Acoustic models detect spoken phonemes, filler words ("um", "uh"), hesitation sounds, mouth clicks, and heavy inhalation.
  4. EDITING: Noise reduction algorithms (Noise v2 / DeepFilterNet) and cut/mute decisions are applied across timelines.
  5. POSTPROCESSING: Normalization to target loudness (e.g., -16 LUFS) and Whisper speech-to-text transcription.
  6. EXPORT: Packaging audio into specified codecs (wav, mp3, flac) and generating CDN download URLs.
  7. SUCCESS / FAILURE: Final output state.

2. Ingestion & Multitrack API Payload Specification

The Cleanvoice v2 API exposes POST https://api.cleanvoice.ai/v2/edits for asynchronous processing. To clean multitrack interviews, you must specify "upload_type": "multitrack" and pass all concurrent track URLs in the files array.

[!IMPORTANT] Batch vs. Multitrack Distinction: Passing multiple audio URLs without "upload_type": "multitrack" or attempting to bundle unrelated podcast episodes into a single request will result in corrupted timelines or merged cross-talk. For unrelated episodes, submit separate POST /v2/edits requests.

Cleanvoice Multitrack JSON Configuration

Below is the reference payload for an interview with a host and guest:

{
  "input": {
    "files": [
      "https://storage.example.com/raw/ep104_host_mic.wav",
      "https://storage.example.com/raw/ep104_guest_mic.wav"
    ],
    "upload_type": "multitrack",
    "config": {
      "remove_noise": true,
      "normalize": true,
      "target_lufs": -16,
      "fillers": true,
      "hesitations": true,
      "mouth_sounds": true,
      "breath": "natural",
      "stutters": true,
      "long_silences": true,
      "muted": false,
      "merge": true,
      "export_format": "wav",
      "transcription": true,
      "summarize": true,
      "export_timestamps": true
    }
  }
}

Parameter Breakdown and Engineering Decisions

ParameterType / ValueEngineering Purpose & 365Finds Recommendation
upload_type"multitrack"Tells the engine that audio files belong to the same session. Essential for cross-microphone analysis.
remove_noisetrueExecutes Noise v2 (the default enhancement engine). Removes steady fan hum, room reverberation, and background artifacts without degrading high-frequency voice timbre.
normalizetrueNormalizes overall loudness. In podcasting, consistent loudness prevents listeners from adjusting volume between speakers.
target_lufs-16 (number)Broadcast industry standard for stereo podcasts (-14 LUFS for short-form clips, -16 LUFS for general episodic audio). Cleanvoice default is -16.
fillers & hesitationstrueDetects filler words across 20+ languages (English, German, French, Spanish, Dutch, etc.) and short hesitations.
mouth_soundstrueEliminates condenser mic clicks, salivary pops, and wet lip releases without phase distortion.
breath"natural"Accepts true, "natural", "legacy", or false. At 365Finds, we strongly recommend "natural" for interviews. Cutting all breaths (true) often produces an unnatural, robotic "vacuum" sensation between spoken phrases.
mutedfalse or trueCritical setting: When true, cuts are replaced with silence instead of splicing the audio timeline. If you intend to import the cleaned tracks back into a Digital Audio Workstation (DAW) like Pro Tools or Reaper, set "muted": true to preserve sample-accurate track alignment.
mergetrue or falseWhen true, Cleanvoice mixes the cleaned multitrack stems down into a single master audio file. Use true for direct-to-publish workflows; use false if your studio performs downstream mastering.
transcriptiontrueRuns an integrated Whisper transcription model across ~99 languages with automatic language detection.
summarizetrueAutomatically derives structured episode titles, chapter markers with timecodes, and concise bullet summaries from the transcript.

3. Storage Optimization: Pre-Signed Uploads and Direct S3 Delivery

A common bottleneck in high-throughput audio pipelines is bandwidth and storage double-handling: downloading raw stems, uploading to Cleanvoice, downloading the processed result, and then re-uploading to long-term storage. Cleanvoice provides two programmatic mechanisms to bypass this overhead.

Mechanism A: Direct Ingestion via Signed Uploads

If your files originate on local disks or temporary worker containers without public URLs, request a temporary presigned upload URL from Cleanvoice:

# 1. Request presigned upload URL
curl -X POST "https://api.cleanvoice.ai/v2/upload?filename=host_track.wav" \
  -H "X-API-Key: $CLEANVOICE_API_KEY"

# Response:
# {"signedUrl": "https://storage.cleanvoice.ai/uploads/xyz-host_track.wav?signature=..."}

# 2. Upload file via HTTP PUT
curl -X PUT "https://storage.cleanvoice.ai/uploads/xyz-host_track.wav?signature=..." \
  -H "Content-Type: audio/wav" \
  --data-binary @/path/to/host_track.wav

Strip the query parameters from signedUrl to obtain the persistent Cleanvoice file URL (https://storage.cleanvoice.ai/uploads/xyz-host_track.wav), and pass it directly inside input.files. Uploaded files are retained securely on EU infrastructure for 7 days.

Mechanism B: Zero-Egress Direct S3 Delivery (signed_url)

To avoid hosting cleaned masters on Cleanvoice servers and manually pulling them back, pass an S3 or Google Cloud Storage presigned PUT URL inside input.config.signed_url:

{
  "input": {
    "files": ["https://storage.example.com/raw/track1.wav", "https://storage.example.com/raw/track2.wav"],
    "upload_type": "multitrack",
    "config": {
      "signed_url": "https://my-podcast-bucket.s3.amazonaws.com/cleaned/ep104_master.wav?X-Amz-Signature=...",
      "remove_noise": true,
      "normalize": true,
      "merge": true
    }
  }
}

When processing finishes, Cleanvoice PUTs the cleaned audio directly into your private storage bucket. The resulting result.download_url points directly to your S3 destination.


4. Designing the Asynchronous Webhook Architecture

Audio rendering is computationally intensive. A 60-minute two-track podcast typically requires 5 to 8 minutes of compute time. Maintaining an open HTTP request during this window invites gateway timeouts (504 Gateway Timeout) and worker crashes.

Production engineering requires an asynchronous worker pattern. Two production implementations exist:

Strategy 1: Serverless S3 Event Trigger (Pure Zero-Polling Webhook)

When using config.signed_url, Cleanvoice uploads the final master directly to Amazon S3 or Cloudflare R2. This upload immediately triggers an s3:ObjectCreated:Put event notification.

Strategy 2: Dedicated Polling-to-Webhook Dispatcher

For environments without S3 event notifications, a lightweight background worker manages API polling and broadcasts internal webhooks when processing succeeds. Cleanvoice documentation recommends waiting 30 seconds before the initial poll, followed by 10-second polling intervals.

# Polling interval and backoff parameters
INITIAL_DELAY_SECONDS = 30
POLL_INTERVAL_SECONDS = 10
MAX_POLL_ATTEMPTS = 120  # Up to 20 minutes execution window

5. Production Implementation: Python Pipeline with Webhook Dispatcher

The following complete Python service demonstrates:

  1. Submitting a multitrack interview to Cleanvoice.
  2. Managing asynchronous lifecycle polling with exponential backoff handling for 429 rate limits (E9001).
  3. Extracting and saving the cleaned audio.
  4. Converting Whisper paragraph data into standard SubRip (.srt) and WebVTT (.vtt) subtitle files.
  5. Emitting an internal webhook payload to downstream services.
import os
import time
import json
import requests
from typing import Dict, Any, List

CLEANVOICE_API_KEY = os.getenv("CLEANVOICE_API_KEY")
BASE_URL = "https://api.cleanvoice.ai/v2"

HEADERS = {
    "X-API-Key": CLEANVOICE_API_KEY,
    "Content-Type": "application/json"
}

def format_timestamp_srt(seconds: float) -> str:
    """Convert float seconds to SRT time format: HH:MM:SS,mmm"""
    millis = int(round((seconds - int(seconds)) * 1000))
    total_seconds = int(seconds)
    hours = total_seconds // 3600
    minutes = (total_seconds % 3600) // 60
    secs = total_seconds % 60
    return f"{hours:02d}:{minutes:02d}:{secs:02d},{millis:03d}"

def format_timestamp_vtt(seconds: float) -> str:
    """Convert float seconds to WebVTT time format: HH:MM:SS.mmm"""
    millis = int(round((seconds - int(seconds)) * 1000))
    total_seconds = int(seconds)
    hours = total_seconds // 3600
    minutes = (total_seconds % 3600) // 60
    secs = total_seconds % 60
    return f"{hours:02d}:{minutes:02d}:{secs:02d}.{millis:03d}"

def generate_subtitles(paragraphs: List[Dict[str, Any]], format_type: str = "srt") -> str:
    """Generates valid SRT or VTT string from Cleanvoice paragraph timestamps."""
    lines = []
    if format_type == "vtt":
        lines.append("WEBVTT\n")

    for idx, p in enumerate(paragraphs, start=1):
        start_sec = p.get("start", 0.0)
        end_sec = p.get("end", start_sec + 2.0)
        text = p.get("text", "").strip()

        if format_type == "srt":
            lines.append(f"{idx}")
            lines.append(f"{format_timestamp_srt(start_sec)} --> {format_timestamp_srt(end_sec)}")
            lines.append(f"{text}\n")
        else:
            lines.append(f"{idx}")
            lines.append(f"{format_timestamp_vtt(start_sec)} --> {format_timestamp_vtt(end_sec)}")
            lines.append(f"{text}\n")

    return "\n".join(lines)

def submit_multitrack_job(track_urls: List[str], merge_tracks: bool = True) -> str:
    """Submits multi-track stems to Cleanvoice /v2/edits."""
    payload = {
        "input": {
            "files": track_urls,
            "upload_type": "multitrack",
            "config": {
                "remove_noise": True,
                "normalize": True,
                "target_lufs": -16,
                "fillers": True,
                "hesitations": True,
                "mouth_sounds": True,
                "breath": "natural",
                "stutters": True,
                "long_silences": True,
                "muted": False,
                "merge": merge_tracks,
                "export_format": "wav",
                "transcription": True,
                "summarize": True,
                "export_timestamps": True
            }
        }
    }

    response = requests.post(f"{BASE_URL}/edits", headers=HEADERS, json=payload, timeout=30)
    response.raise_for_status()
    job_id = response.json().get("id")
    print(f"[*] Submitted Multitrack Job. Edit ID: {job_id}")
    return job_id

def poll_and_dispatch_webhook(edit_id: str, webhook_target_url: str):
    """
    Polls Cleanvoice for completion and dispatches a rich webhook payload.
    Implements 30s initial delay and exponential backoff on 429 rate limits.
    """
    print("[*] Waiting 30 seconds before initial status check...")
    time.sleep(30)

    delay = 10
    attempts = 0
    max_attempts = 120  # 20 minutes limit

    while attempts < max_attempts:
        attempts += 1
        url = f"{BASE_URL}/edits/{edit_id}"
        resp = requests.get(url, headers=HEADERS, timeout=15)

        # Handle API Rate Limits (E9001 / 429)
        if resp.status_code == 429:
            print("[!] Rate limit encountered. Backing off 20 seconds...")
            time.sleep(20)
            continue

        resp.raise_for_status()
        data = resp.json()
        status = data.get("status")
        print(f"[*] Attempt {attempts}: Status = {status}")

        if status == "SUCCESS":
            result = data.get("result", {})
            download_url = result.get("download_url")
            transcription = result.get("transcription", {})
            summarization = result.get("summarization", {})

            # Extract paragraphs for SRT / VTT generation
            paragraphs = transcription.get("paragraphs", [])
            srt_content = generate_subtitles(paragraphs, format_type="srt")
            vtt_content = generate_subtitles(paragraphs, format_type="vtt")

            # Construct Webhook Payload for Internal Services
            webhook_payload = {
                "event": "podcast.audio.cleaned",
                "edit_id": edit_id,
                "status": "SUCCESS",
                "master_audio_url": download_url,
                "subtitles": {
                    "srt": srt_content,
                    "vtt": vtt_content
                },
                "metadata": {
                    "title": summarization.get("title"),
                    "summary": summarization.get("summary"),
                    "chapters": summarization.get("chapters", []),
                    "key_learnings": summarization.get("key_learnings", "")
                }
            }

            print(f"[*] Job succeeded. Dispatching webhook to: {webhook_target_url}")
            webhook_resp = requests.post(
                webhook_target_url,
                json=webhook_payload,
                headers={"Content-Type": "application/json"},
                timeout=15
            )
            print(f"[*] Webhook dispatched. Server responded: {webhook_resp.status_code}")
            return webhook_payload

        elif status == "FAILURE":
            raise RuntimeError(f"[-] Cleanvoice job failed: {data}")

        time.sleep(delay)

    raise TimeoutError("[-] Edit processing exceeded maximum allotted polling duration.")

if __name__ == "__main__":
    # Example execution
    stems = [
        "https://storage.example.com/podcasts/ep42_host.wav",
        "https://storage.example.com/podcasts/ep42_guest.wav"
    ]
    webhook_url = "https://api.mystudio.com/webhooks/audio-completed"

    edit_job_id = submit_multitrack_job(stems, merge_tracks=True)
    poll_and_dispatch_webhook(edit_job_id, webhook_url)

6. Real-World Trade-Offs & 365Finds Research Verdict

Implementing automated multitrack processing requires balancing speed, audio transparency, and downstream workflow compatibility. At 365Finds, our research yields four essential operational recommendations:

1. The Phase & Timeline Decision: muted: true vs. merge: true

2. Breath Attenuation: Avoid Aggressive Breath Stripping

Podcast voices stripped completely of inhalations sound clinical, abrupt, and unnatural to listeners wearing in-ear headphones. While breath: true is effective for noisy environments, 365Finds recommends "breath": "natural" or "breath": "legacy" for dynamic conversational interviews. This softens sudden gasps while retaining natural speech rhythm.

3. Rate Limit Management & Concurrency

Cleanvoice enforces account-level rate limits on POST /v2/edits and GET /v2/edits/{id}. Exceeding limits triggers an HTTP 429 response:

{
  "error": {
    "code": "E9001",
    "message": "Rate limit exceeded. Please try again later."
  }
}

In high-volume studios, queue outgoing edit requests using Redis or Celery with a concurrency cap (e.g., 5 to 10 concurrent jobs). Never poll GET /v2/edits/{id} faster than once every 5 seconds. Polling every 10 to 15 seconds after a 30-second initial wait keeps traffic well below threshold boundaries.

4. Immediate Asset Archival

Cleanvoice stores generated assets on EU servers for 7 days, after which files are permanently purged. Production webhooks must immediately download the cleaned audio asset (result.download_url) or route it directly via signed_url into cold storage (Amazon S3 Glacier, Google Cloud Storage, or Cloudflare R2).


References