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

> Re-run lyrics synchronization on an existing project

Lyrics sync aligns lyric text to the audio so words highlight at the right moment. Use `client.projects.syncLyrics(...)` to re-run sync on any project with updated lyrics, a different model, or a new language.

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

Start a new lyrics sync operation.

```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 source

Pass a `lyricsSource` object in the request body:

<Tabs>
  <Tab title="transcribe">
    Let the model transcribe lyrics from the audio.

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

  <Tab title="align">
    Pass exact lyrics. The model aligns them to the audio.

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

### Sync models

**Alignment models** (use with `align` when you have accurate lyrics):

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

**Transcription models** (use with `transcribe`):

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

See [Sync model reference](/en/desktop/sync-model) for guidance.

## End-to-end example

```ts theme={null}
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](/en/sdk/stems) — re-run stem separation before re-syncing
* [Tasks](/en/sdk/tasks) — operation handles and abort patterns
* [Sync model reference](/en/desktop/sync-model) — pick the right model
