Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.youka.io/llms.txt

Use this file to discover all available pages before exploring further.

Lyrics sync richtet den Liedtext am Audio aus, sodass Wörter im richtigen Moment hervorgehoben werden. Verwende client.projects.syncLyrics(...), um die Synchronisierung für jedes Projekt erneut auszuführen — z. B. mit aktualisierten Lyrics, einem anderen Modell oder einer neuen Sprache.

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

Startet eine neue Lyrics-Synchronisierungsoperation.
const operation = await client.projects.syncLyrics("prj_abc123", {
  lyricsSource: {
    type: "align",
    lyrics: "First line\nSecond line\n...",
    syncModel: "audioshake-alignment",
  },
});

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

Lyrics source

Übergebe ein lyricsSource-Objekt im Request-Body:
Lasse das Modell Lyrics aus dem Audio transkribieren.
{
  lyricsSource: {
    type: "transcribe",
    syncModel: "audioshake-transcription",
    language: "en",
  },
}

Sync models

Alignment models (mit align verwenden, wenn du genaue Lyrics hast):
  • audioshake-alignment
  • musicai-alignment
  • musicai-alignment-subword
Transcription models (mit transcribe verwenden):
  • audioshake-transcription
  • musicai-transcription
  • wav2vec2
  • whisper
Siehe Sync model reference für Hinweise.

End-to-end example

import { YoukaClient } from "@youka/sdk";
import { readFile } from "node:fs/promises";

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

async function reAlignLyrics(projectId: string) {
  const lyrics = await readFile("./lyrics.txt", "utf8");

  const operation = await client.projects.syncLyrics(projectId, {
    lyricsSource: {
      type: "align",
      lyrics,
      syncModel: "audioshake-alignment",
      language: "en",
    },
  });

  const { project } = await client.projects.wait(operation);
  console.log("Updated lyrics with", project.lyrics?.length, "lines");
}

What’s next

  • Stems — Stem-Separation erneut ausführen, bevor du erneut synchronisierst
  • Tasks — Operation-Handles und Abort-Patterns
  • Sync model reference — das richtige Modell auswählen