Skip to main content
Stems sind die Gesangs- und Instrumentalspuren, die aus dem Quell-Audio extrahiert werden. Youka trennt Stems automatisch, wenn du ein Projekt erstellst, aber du kannst die Trennung jederzeit mit einem anderen Modell erneut ausführen.

client.projects.separateStems(projectId, body, options?)

Startet eine neue Stammtrennungs-Operation für ein Projekt.
const operation = await client.projects.separateStems("prj_abc123", {
  splitModel: "audioshakeai",
});

const { project } = await client.projects.wait(operation);
console.log(project.stems);

Parameters

projectId
string
required
Das Projekt, das erneut verarbeitet werden soll.
splitModel
SplitModel
Modell zur Stammtrennung. Siehe Split model reference als Orientierungshilfe.

Available models

ValueDescription
mdx23cStandard. Ausgewogene Qualität und Tempo.
audioshakeaiHochwertige AudioShake-Trennung.
audioshake_vocals_leadNur Vocals und Lead Vocals.
musicai_instrumental_onlyAusgabe nur Instrumental.
musicai_lead_backing_otherLead, Backing Vocals und andere Stems.
musicai_with_backing_vocalsVocals inklusive Backing-Tracks.
musicai_without_backing_vocalsNur Lead Vocals.
uvr_mdxnet_kara_2Karaoke-optimiertes UVR-Modell.
bs_roformerBS-Roformer-Modell.
mel_band_roformer_instrumental_becruilyMel-Band Roformer Instrumental.
mel_band_roformer_instrumental_instv7_gaboxAlternatives Mel-Band Instrumental.
demucsFacebook Demucs.

End-to-end example

import { YoukaClient, YoukaTaskError } from "@youka/de/sdk";

const client = new YoukaClient({ apiKey: process.env.YOUKA_API_KEY! });

async function reRunStems(projectId: string) {
  const operation = await client.projects.separateStems(projectId, {
    splitModel: "audioshakeai",
  });

  try {
    const { project } = await client.projects.wait(operation);
    console.log("New stems:", project.stems);
  } catch (error) {
    if (error instanceof YoukaTaskError) {
      console.error("Stem separation failed:", error.code, error.message);
      throw error;
    }
    throw error;
  }
}
Verwende client.tasks.get(taskId) oder client.tasks.wait(taskId) nur dann, wenn du ausdrücklich Low-Level-Zugriff auf Tasks brauchst. Die meisten Aufrufer sollten bei client.projects.wait(operation) bleiben.

client.projects.downloadStem(projectId, selector, options?)

Lade einen Stem herunter, ohne ihn in ein anderes Format zu konvertieren. Wähle genau einen Stem per ID oder Typ aus:
await client.projects.downloadStem(
  "prj_abc123",
  { type: "instrumental" },
  { output: "./stems" },
);

await client.projects.downloadStem(
  "prj_abc123",
  { stemId: "stm_abc123" },
  { output: "./stems/original.wav" },
);
Unterstützte Typen sind original, instrumental, vocals und backing_vocals.

client.projects.downloadStems(projectId, selector?, options?)

Lade mehrere Stems herunter. Übergib types, übergib stemIds oder lasse den Selector weg, um jeden verfügbaren Stem herunterzuladen:
await client.projects.downloadStems(
  "prj_abc123",
  { types: ["original", "instrumental", "vocals"] },
  { output: "./stems" },
);

await client.projects.downloadStems("prj_abc123", undefined, {
  output: "./stems",
});
Für Downloads mehrerer Stems verwende ein Ausgabeverzeichnis. Das SDK schreibt die original gespeicherten Stem-Dateien und transkodiert sie nicht.

What’s next

  • Lyrics sync — Lyrics nach dem Austauschen von Stems neu synchronisieren
  • Tasks — Operation-Handles und erweitertes Task-Polling
  • Split model reference — das passende Modell auswählen