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

# Erste Schritte - VOICEVOX für Laravel

> Grundlegende Konzepte von VOICEVOX für Laravel, Vergleich der drei Modi, Schnellstart (Client-Modus) und Hauptfunktionen im Überblick.

VOICEVOX für Laravel ist ein Paket zur Nutzung der Sprachsynthese-Funktion von VOICEVOX in Laravel. Sie können aus Text japanische Sprache erzeugen.

<Tip>
  Am schnellsten starten Sie mit dem Client-Modus. In Umgebungen mit FFI können Sie später schrittweise auf den Native-Modus oder den Engine-API-Modus umsteigen.
</Tip>

## Drei Nutzungsmodi

| Modus            | Ausführung                                      | FFI                | Geeigneter Einsatz                                        | Guide                                                                                                               |
| ---------------- | ----------------------------------------------- | ------------------ | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Client-Modus     | HTTP-Verbindung zur offiziellen VOICEVOX-Engine | Nicht erforderlich | Zum Ausprobieren, Docker-Umgebungen, Umgebungen ohne FFI  | [Client Talk](/de/packages/laravel-voicevox/client-talk) / [Client Song](/de/packages/laravel-voicevox/client-song) |
| Native-Modus     | Direkter Aufruf des VOICEVOX CORE über PHP-FFI  | Erforderlich       | Geschwindigkeit, Offline-Ausführung, CLI-Tool-Integration | [Native Talk](/de/packages/laravel-voicevox/native-talk) / [Native Song](/de/packages/laravel-voicevox/native-song) |
| Engine-API-Modus | Laravel bietet eine VOICEVOX-kompatible API     | Erforderlich       | Bereitstellung als API-Server, Multi-Client-Integration   | [Engine Talk](/de/packages/laravel-voicevox/engine-talk) / [Engine Song](/de/packages/laravel-voicevox/engine-song) |

## Schnellstart

Schritte für den Client-Modus.

<Steps>
  <Step title="Paket installieren">
    ```shell theme={null}
    composer require revolution/laravel-voicevox
    ```

    Details siehe [Installation und Konfiguration](/de/packages/laravel-voicevox/installation).
  </Step>

  <Step title="Offizielle Engine starten">
    ```shell theme={null}
    docker pull voicevox/voicevox_engine:cpu-latest
    docker run --rm -p '127.0.0.1:50021:50021' voicevox/voicevox_engine:cpu-latest
    ```
  </Step>

  <Step title="Sprachsynthese ausprobieren">
    ```php theme={null}
    use Revolution\Voicevox\Voicevox;

    $response = Voicevox::talk('こんにちは、Laravel です。', id: 1)->generate(id: 1);
    $response->storeAs('output.wav');
    ```
  </Step>
</Steps>

## Hauptfunktionen

### Sprachsynthese (Talk)

```php theme={null}
use Revolution\Voicevox\Client\TalkAudioQuery;
use Revolution\Voicevox\Voicevox;

$response = Voicevox::talk('こんにちは', id: 1)
    ->tap(function (TalkAudioQuery $talk) {
        $talk->audioQuery['speedScale'] = 1.2;
        $talk->audioQuery['pitchScale'] = 0.05;
        $talk->audioQuery['intonationScale'] = 1.5;
        $talk->audioQuery['volumeScale'] = 1.0;
    })
    ->generate(id: 1);
```

### Gesangssynthese (Song)

```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(ticks: 480, bpm: 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)->generate(id: 3001);
```

### Benutzerwörterbuch und Presets

Im Client-Modus verwalten Sie über die `Voicevox`-Facade das Benutzerwörterbuch und die Presets auf der Seite der offiziellen Engine.

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

$uuid = Voicevox::addWord(
    surface: 'Laravel',
    pronunciation: 'ララベル',
    accentType: 3,
);

$presetId = Voicevox::addPreset([
    'id' => 0,
    'name' => 'ゆっくり丁寧',
    'speaker_uuid' => '7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff',
    'style_id' => 1,
    'speedScale' => 0.8,
    'pitchScale' => 0.0,
    'intonationScale' => 1.2,
    'volumeScale' => 1.0,
    'prePhonemeLength' => 0.1,
    'postPhonemeLength' => 0.1,
]);
```

### Laravel-AI-SDK-Integration

```php theme={null}
use Laravel\Ai\Audio;

$audio = Audio::of('こんにちは、Laravel です。')
    ->voice('ずんだもん')
    ->generate();

$audio->storeAs('output.wav');
```

## Nächste Schritte

* [Installation und Konfiguration](/de/packages/laravel-voicevox/installation)
* [Konfigurationsreferenz](/de/packages/laravel-voicevox/configuration)
* [Client Talk](/de/packages/laravel-voicevox/client-talk)
* [Client Song](/de/packages/laravel-voicevox/client-song)
* [Client-Modus - Benutzerwörterbuch](/de/packages/laravel-voicevox/client-user-dict)
* [Client-Modus - Presets](/de/packages/laravel-voicevox/client-presets)
* [Native Talk](/de/packages/laravel-voicevox/native-talk)
* [Engine Talk](/de/packages/laravel-voicevox/engine-talk)
* [Native-Modus - Benutzerwörterbuch](/de/packages/laravel-voicevox/native-user-dict)
* [Native-Modus - Presets](/de/packages/laravel-voicevox/native-presets)
* [AI-SDK-Integration](/de/packages/laravel-voicevox/ai-sdk)


## Related topics

- [Installation und Konfiguration - VOICEVOX für Laravel](/de/packages/laravel-voicevox/installation.md)
- [Erste Schritte - GitHub Copilot SDK für Laravel](/de/packages/laravel-copilot-sdk/getting-started.md)
- [Client-Modus: Talk (Text-Sprachsynthese) - VOICEVOX für Laravel](/de/packages/laravel-voicevox/client-talk.md)
- [Native-Modus - Benutzerwörterbuch - VOICEVOX für Laravel](/de/packages/laravel-voicevox/native-user-dict.md)
- [Client-Modus - Presets - VOICEVOX für Laravel](/de/packages/laravel-voicevox/client-presets.md)
