> ## Documentation Index
> Fetch the complete documentation index at: https://kawax.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Engine-API-Modus: Song (Gesangs-Sprachsynthese) - VOICEVOX für Laravel

> Beschreibt, wie Sie in der VOICEVOX-Engine-kompatiblen API in einer Laravel-Anwendung die Endpunkte zur Gesangssynthese verwenden.

## Singen lassen über die Engine-API

Der Engine-API-Modus bietet auch Song-Endpunkte, die mit der offiziellen VOICEVOX-Engine kompatibel sind.

<Info>
  Für die grundlegende Einrichtung der Engine-API prüfen Sie zuerst [Engine-API: Talk](/de/packages/laravel-voicevox/engine-talk).
</Info>

## Vorbereitung

Damit das Gesangsmodell verwendet werden kann, prüfen Sie, dass `s0.vvm` in `core.vvms` in `config/voicevox.php` enthalten ist (standardmäßig enthalten).

```dotenv theme={null}
VOICEVOX_CORE_PATH=/path/to/voicevox_core/
```

## Laravel-Version der Engine starten

```shell theme={null}
php artisan serve --port=50513
```

## Gesangsaudio generieren

### 1. `sing_frame_audio_query` erstellen

```shell theme={null}
curl -s -X POST "http://127.0.0.1:50513/sing_frame_audio_query?speaker=6000" \
  -H "Content-Type: application/json" \
  -d '{
    "notes": [
      {"id": "a", "key": null, "frame_length": 15, "lyric": ""},
      {"id": "b", "key": 60, "frame_length": 94, "lyric": "ド"},
      {"id": "c", "key": 62, "frame_length": 94, "lyric": "レ"},
      {"id": "d", "key": 64, "frame_length": 187, "lyric": "ミ"},
      {"id": "e", "key": null, "frame_length": 2, "lyric": ""}
    ]
  }' \
  > frame_audio_query.json
```

Für `speaker` geben Sie eine Style-ID vom Typ `sing` oder `singing_teacher` an (z. B. 6000).

### 2. Sprachsynthese mit `frame_synthesis`

```shell theme={null}
curl -s -X POST "http://127.0.0.1:50513/frame_synthesis?speaker=3001" \
  -H "Content-Type: application/json" \
  -d @frame_audio_query.json \
  > song.wav
```

Für `speaker` geben Sie eine Style-ID vom Typ `sing` oder `frame_decode` an (z. B. 3001).

## Verwendung aus einem Laravel-Client

Sie können `Voicevox::song()` auf die Laravel-Version der Engine ausrichten.

```php theme={null}
// config/voicevox.php
'client' => [
    'url' => env('VOICEVOX_URL', 'http://127.0.0.1:50513'),
],
```

```php theme={null}
use Revolution\Voicevox\Song\Note;
use Revolution\Voicevox\Song\Score;
use Revolution\Voicevox\Voicevox;

$score = Score::make([
    Note::make(length: 15),
    Note::make(length: Note::len(480, 120), lyric: 'ド', key: 60),
    Note::make(length: Note::len(480, 120), lyric: 'レ', key: 62),
    Note::make(length: Note::len(960, 120), lyric: 'ミ', key: 64),
    Note::make(length: 2),
]);

$response = Voicevox::song($score, teacher: 6000)->generate(id: 3001);

$response->storeAs('engine', 'song.wav');
```

## Endpunkte für F0- und Lautstärke-Anpassung

```shell theme={null}
curl -s -X POST "http://127.0.0.1:50513/sing_frame_f0?speaker=6000" \
  -H "Content-Type: application/json" \
  -d '{"score": {...}, "frame_audio_query": {...}}' \
  > f0.json

curl -s -X POST "http://127.0.0.1:50513/sing_frame_volume?speaker=6000" \
  -H "Content-Type: application/json" \
  -d '{"score": {...}, "frame_audio_query": {...}}' \
  > volume.json
```

<Warning>
  Wenn Sie F0 und Lautstärke einzeln aktualisieren, führen Sie es unbedingt in der Reihenfolge **F0 → Lautstärke** aus.
</Warning>

## Unterstützungsstatus der Song-Endpunkte

| Endpunkt                       | Laravel-Version | Fallback | Hinweise                                      |
| ------------------------------ | --------------- | -------- | --------------------------------------------- |
| `POST /sing_frame_audio_query` | ✅               | ✅        |                                               |
| `POST /frame_synthesis`        | ✅               | ✅        |                                               |
| `POST /sing_frame_f0`          | ✅               | ✅        |                                               |
| `POST /sing_frame_volume`      | ✅               | ✅        | Aktualisierung in der Reihenfolge f0 → volume |
| `GET /singers`                 | ✅               | ✅        |                                               |
| `GET /singer_info`             | ✅               | ✅        | Ressourceninstallation erforderlich           |

## Nächste Seiten

<Columns cols={3}>
  <Card title="Score- und Note-Details" href="/de/packages/laravel-voicevox/song-score-note" icon="list-music">
    Details zu `Score` und `Note`, die in der Song-API verwendet werden.
  </Card>

  <Card title="Engine-API: Talk" href="/de/packages/laravel-voicevox/engine-talk" icon="message-circle">
    Verwendung der Endpunkte zur Text-Sprachsynthese.
  </Card>

  <Card title="Client: Song" href="/de/packages/laravel-voicevox/client-song" icon="music">
    Modus, der dieselbe Partitur direkt an die offizielle Engine sendet.
  </Card>
</Columns>


## Related topics

- [Native-Modus: Song (Gesangs-Sprachsynthese) - VOICEVOX für Laravel](/de/packages/laravel-voicevox/native-song.md)
- [Client-Modus: Song (Gesangs-Sprachsynthese) - VOICEVOX für Laravel](/de/packages/laravel-voicevox/client-song.md)
- [Engine-API-Modus: Talk (Text-Sprachsynthese) - VOICEVOX für Laravel](/de/packages/laravel-voicevox/engine-talk.md)
- [Native-Modus: Talk (Text-Sprachsynthese) - VOICEVOX für Laravel](/de/packages/laravel-voicevox/native-talk.md)
- [Entwicklungsleitfaden für Engine-API-Integrationsanwendungen - VOICEVOX für Laravel](/de/packages/laravel-voicevox/app-guide.md)
