Audio Separation
Submit audio and retrieve separated dialogue, music, and effects tracks.
Audio Separation is an asynchronous API.
Create a task
Submit a multipart file with POST /v1/audio/separations.
import { readFile } from "node:fs/promises";
const form = new FormData();
form.append(
"file",
new Blob([await readFile("scene.wav")], { type: "audio/wav" }),
"scene.wav",
);
const response = await fetch("https://taskinfer.com/v1/audio/separations", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TASKINFER_API_KEY}` },
body: form,
});
if (!response.ok) throw new Error(await response.text());
const task = await response.json();
console.log(task.id, task.status);Task lifecycle
Poll GET /v1/audio/separations/{id} until the task is completed or failed. The create response uses one of four states:
queuedin_progresscompletedfailed
Poll the task
const response = await fetch(
`https://taskinfer.com/v1/audio/separations/${task.id}`,
{ headers: { Authorization: `Bearer ${process.env.TASKINFER_API_KEY}` } },
);
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());Completed output
A completed task contains exactly three output URLs:
{
"id": "631474364805546810",
"object": "audio.separation",
"status": "completed",
"duration": 61.2,
"created_at": 1786089600,
"completed_at": 1786089642,
"error": null,
"output": {
"dialogue": "https://...",
"music": "https://...",
"effects": "https://..."
}
}Output URLs are supplied by the processing provider and may be temporary. Download required results promptly.
Limits and billing
The endpoint accepts MP3, MP4/M4A, WAV, and WebM files up to 100 MB. It is billed at 20,000 credits per started audio minute (approximately $0.02 per minute).
Errors
For common HTTP failures, see Errors and troubleshooting.
Related guides
Prepare authentication in Get started. For endpoint and request definitions, see the API Reference.