惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
Vercel News
Vercel News
Martin Fowler
Martin Fowler
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LangChain Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
阮一峰的网络日志
阮一峰的网络日志
F
Fortinet All Blogs

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
The Best Resources for Audio Stem Separation in Python (2...
StemSplit · 2026-05-09 · via DEV Community

StemSplit

Audio source separation has gone from a niche research problem to something you can do in a few lines of Python. The tooling has improved dramatically in the past two years, but the documentation is scattered. Here's a curated list of the resources actually worth reading in 2026.

Understanding the technology first

Before you write any code, it's worth understanding what you're working with. Modern stem separation uses neural networks trained on large datasets of music with known stems. The current state-of-the-art open source model is HTDemucs from Meta AI Research — a hybrid transformer architecture that processes both the waveform and spectrogram simultaneously.

The practical Python guides

For the full implementation comparison:

Demucs, Spleeter & API Compared (Hashnode) — covers all three approaches with working code. Particularly useful for the async polling loop implementation, which is where most first attempts fall over. Compares running models locally vs. calling a REST API, with honest tradeoffs for each.

For a specific end-to-end pipeline:

Full acapella extraction pipeline (Hashnode) — YouTube download with yt-dlp → API submission → async polling → stem download. Good template if you're building something similar.

The core libraries

# The three you'll actually use
pip install demucs          # HTDemucs local inference
pip install yt-dlp          # Audio download from YouTube/SoundCloud/etc.
pip install requests        # REST API calls

Enter fullscreen mode Exit fullscreen mode

Demucs — for local inference on GPU. Best quality, most control, needs CUDA.

yt-dlp — the standard for downloading audio from streaming platforms. Handles YouTube, SoundCloud, Bandcamp, and hundreds more.

StemSplit API — if you want cloud inference without managing GPU infrastructure. Has a free tier for testing and documented REST endpoints. The separation quality is the same as local HTDemucs (it runs the same model).

The non-obvious parts

Polling is mandatory. Separation is asynchronous — you submit a job and poll for results. Build this correctly from the start: exponential backoff, timeout handling, status codes.

Local Demucs needs GPU to be practical. CPU inference on HTDemucs takes 10–15 minutes per track. GPU drops that to under 90 seconds. If you're on CPU-only hardware, an API is more practical.

File format matters. HTDemucs works best on WAV or FLAC. MP3 compression artifacts can affect separation quality on bass-heavy content specifically.

Genre affects results. Models trained on pop/rock generalize well to hip-hop and R&B. Jazz with unusual voicings and non-Western music are harder. Test on your actual content before building a pipeline around it.

Quick starter

import subprocess
import requests
import time

# Download audio with yt-dlp
subprocess.run(["yt-dlp", "-x", "--audio-format", "wav", "-o", "track.wav", "YOUTUBE_URL"])

# Submit to StemSplit API
with open("track.wav", "rb") as f:
    r = requests.post(
        "https://stemsplit.io/api/v1/separate",
        headers={"Authorization": "Bearer YOUR_API_KEY"},
        files={"audio": f},
        data={"stems": "4"},
    )
job_id = r.json()["job_id"]

# Poll for results
while True:
    status = requests.get(
        f"https://stemsplit.io/api/v1/jobs/{job_id}",
        headers={"Authorization": "Bearer YOUR_API_KEY"},
    ).json()
    if status["status"] == "complete":
        print(status["stems"])  # URLs for each stem
        break
    time.sleep(5)

Enter fullscreen mode Exit fullscreen mode

For the complete implementation with error handling, retries, and batch processing — see the full guide on Hashnode.


Drop questions in the comments if anything is unclear. This is a fast-moving space and I'll update this post when significant changes happen.