Tutorial · Python · ~10 min

Isolate Environmental Sounds

That perfect rain ambience is buried under music and dialogue. Separate it out.

PythonSound EffectsAPI

Why this matters

Sound designers constantly need clean ambience — rain, traffic, crowd — from real footage. Recording it fresh is expensive; extracting it from existing footage is a separation problem.

Beyond the common stems (vocals, drums, bass), the model can isolate environmental and FX content into its own stem.

How it works

Submit the clip with stems=[sfx]; the API returns the environmental stem plus the rest, time-aligned for post-production.

Submit a job with an input URL (S3, GCS or HTTPS), poll the job URL, and download the rendered output. No GPU, no queues, no ffmpeg builds to babysit.

Code

Python
import requests, time

API = "https://api.mlslabs.io/v1/source-separation/jobs"
headers = {"X-API-Key": "YOUR_API_KEY"}
payload = {"input": "s3://bucket/rain.mp4", "stems": ["sfx"]}

resp = requests.post(API, json=payload, headers=headers)
job = resp.json()
while job["status"] not in ("succeeded", "failed"):
    time.sleep(3)
    job = requests.get(job["url"], headers=headers).json()

print("Output:", job["output_url"])

Pro tips

  • Longer clips give richer ambience — a 2-minute pass beats a 10-second loop.
  • Combine sfx stems from multiple clips for dense layers.
  • Keep the dialogue stem too — it often contains usable room tone.

Pricing note

Usage is metered per minute of media processed; the first tier is free each month. Volume discounts kick in automatically.

FAQ

Common questions

Does it separate specific sounds (just rain, not traffic)?

You get a general environmental stem; fine-grained classification (rain vs traffic) is a future capability.

Is it useful for game audio?

Yes — extracted ambience layers fit directly into game audio pipelines.

What formats?

WAV/FLAC output; the input can be video or audio.