> ## 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-Synchronisierung

> Lyrics-Synchronisierung für ein bestehendes Projekt erneut ausführen

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

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

Starte eine neue Lyrics-Synchronisierungsoperation.

```ts theme={null}
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-Quelle

Übergebe ein `lyricsSource`-Objekt im Request-Body:

<Tabs>
  <Tab title="transcribe">
    Lass das Modell Lyrics aus dem Audio transkribieren.

    ```ts theme={null}
    {
      lyricsSource: {
        type: "transcribe",
        syncModel: "audioshake-transcription",
        language: "en",
      },
    }
    ```
  </Tab>

  <Tab title="align">
    Übergebe die exakten Lyrics. Das Modell richtet sie am Audio aus.

    ```ts theme={null}
    {
      lyricsSource: {
        type: "align",
        lyrics: "First line\nSecond line\n...",
        syncModel: "audioshake-alignment",
        language: "en",
      },
    }
    ```
  </Tab>
</Tabs>

### Sync-Modelle

**Alignment-Modelle** (verwende sie mit `align`, wenn du genaue Lyrics hast):

* `audioshake-alignment`
* `musicai-alignment`
* `musicai-alignment-subword`

**Transkriptionsmodelle** (verwende sie mit `transcribe`):

* `audioshake-transcription`
* `musicai-transcription`
* `wav2vec2`
* `whisper`

Siehe [Sync model reference](/de/desktop/sync-model) für Hinweise.

## End-to-End-Beispiel

```ts theme={null}
import { YoukaClient } from "@youka/de/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");
}
```

## Was kommt als Nächstes

* [Stems](/de/sdk/stems) — Stem-Separation erneut ausführen, bevor du erneut synchronisierst
* [Tasks](/de/sdk/tasks) — Operation-Handles und Abbruchmuster
* [Sync model reference](/de/desktop/sync-model) — das richtige Modell auswählen
