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

# VOICEVOX for Laravel

> Een overzicht van het pakket waarmee je vanuit Laravel de client-, native en engine-API van VOICEVOX gebruikt, met de ingangen naar elke modus.

## Overzicht

[revolution/laravel-voicevox](https://github.com/invokable/laravel-voicevox) is een pakket om VOICEVOX te gebruiken vanuit Laravel.

Je gebruikt in dezelfde Laravel-stijl zowel de clientmodus, die via HTTP verbinding maakt met de officiële engine, als de native modus, die in combinatie met [VOICEVOX Core for PHP](/nl/packages/voicevox-core-php) rechtstreeks synthetiseert via PHP FFI.

<Info>
  Wil je eerst de basiskennis over FFI op een rij zetten, lees dan [PHP FFI](/nl/advanced/ffi); voor de setup van de corebibliotheek zelf, zie [VOICEVOX Core for PHP](/nl/packages/voicevox-core-php) en [Gebruik](/nl/packages/voicevox-core-php/usage).
</Info>

## Functietabel

| Feature                                      | Supported | Description                                                                                                                                                                                                                    |
| -------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| VOICEVOX Client                              | ✅         | Benadert de officiële VOICEVOX-engine-API via HTTP. FFI is niet nodig.                                                                                                                                                         |
| VOICEVOX Core                                | ✅         | Gebruikt de dynamische bibliotheek van VOICEVOX CORE via [VOICEVOX Core for PHP](/nl/packages/voicevox-core-php).                                                                                                              |
| Laravel style                                | ✅         | Op z'n Laravels te gebruiken met facades, helpers, `config/voicevox.php` en `.env`.                                                                                                                                            |
| Laravel AI SDK-integratie                    | ✅         | Ook te gebruiken vanuit de Audio-workflow van de Laravel AI SDK.                                                                                                                                                               |
| VOICEVOX Engine                              | ⚠️        | Bouwt een VOICEVOX-compatibele API in je Laravel-app in. Niet-ondersteunde onderdelen vallen terug op de officiële engine.                                                                                                     |
| VOICEVOX Engine / OpenAI-compatibele TTS API | ✅         | `/v1/audio/speech`; voice ondersteunt net als in de AI SDK naast stijl-ID's ook aliassen zoals "ずんだもん".                                                                                                                        |
| VOICEVOX Editor                              | ⚠️        | Er is een songgerichte app voor macOS ontwikkeld, maar er zijn geen plannen om die via een appstore te publiceren of te distribueren. Als de code ooit op GitHub wordt gepubliceerd, kun je hem met Xcode bouwen en gebruiken. |

## Vereisten

* PHP 8.3+
* Laravel 12+
* `ext-zip`
* `ext-ffi` als je de native modus / engine-API gebruikt
* Een lokale CLI-omgeving

<Warning>
  In gangbare webserveromgevingen, waaronder Laravel Cloud, is FFI vaak uitgeschakeld; ga er daarom van uit dat de native modus en de engine-API **bedoeld zijn voor een lokale CLI**.
</Warning>

## Modusoverzicht

| Modus       | Uitvoering                                   | FFI        | Belangrijkste toepassing            | Gids                                                       |
| ----------- | -------------------------------------------- | ---------- | ----------------------------------- | ---------------------------------------------------------- |
| Client Talk | HTTP-requests naar de officiële engine       | Niet nodig | Tekst-naar-spraak                   | [client-talk](/nl/packages/laravel-voicevox/client-talk)   |
| Client Song | HTTP-requests naar de officiële engine       | Niet nodig | Zangsynthese                        | [client-song](/nl/packages/laravel-voicevox/client-song)   |
| Native Talk | VOICEVOX CORE rechtstreeks aanroepen via FFI | Vereist    | Lokale tekst-naar-spraak            | [native-talk](/nl/packages/laravel-voicevox/native-talk)   |
| Native Song | VOICEVOX CORE rechtstreeks aanroepen via FFI | Vereist    | Lokale zangsynthese                 | [native-song](/nl/packages/laravel-voicevox/native-song)   |
| Engine-API  | Compatibele API in de Laravel-app            | Vereist    | Ingebouwde VOICEVOX-compatibele API | [installation](/nl/packages/laravel-voicevox/installation) |

## Waarom `tap()` hier zo goed past

Dit pakket geeft direct na `talk()` / `song()` het audioquery-object terug en laat je vóór `generate()` een aanpassingsfase invoegen.

Daarom is met `tap()` de schrijfwijze **alleen de query aanpassen zonder de returnwaarde te veranderen** heel natuurlijk.

```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;
    })
    ->generate(id: 1);
```

* Bij talk kun je onder andere `speedScale` en `pitchScale` aanpassen.
* Bij song kun je met `sync()` F0 en volume opnieuw berekenen.
* Je kunt netjes doorchainen naar de `VoicevoxResponse` die `generate()` teruggeeft.

<Info>
  De gedachte achter `tap()` zelf staat beschreven in [De tap()-helper en de Tappable-trait](/nl/advanced/tap). Dit pakket is een bijzonder duidelijk praktijkvoorbeeld.
</Info>

## Documentatie

<Columns cols={2}>
  <Card title="Installatie" href="/nl/packages/laravel-voicevox/installation" icon="download">
    Bekijk installatie met alleen de client, installatie met FFI, het publiceren van het configuratiebestand en het voorbereiden van engine-resources.
  </Card>

  <Card title="Client Talk" href="/nl/packages/laravel-voicevox/client-talk" icon="message-circle">
    Begin met tekst-naar-spraak via de officiële VOICEVOX-engine.
  </Card>

  <Card title="Client Song" href="/nl/packages/laravel-voicevox/client-song" icon="music">
    Bouw een `Score` en `Note`s op en synthetiseer zang.
  </Card>

  <Card title="Native Talk" href="/nl/packages/laravel-voicevox/native-talk" icon="cpu">
    Synthetiseer lokaal met PHP FFI en VOICEVOX CORE.
  </Card>

  <Card title="Native Song" href="/nl/packages/laravel-voicevox/native-song" icon="music">
    Gebruik het zangmodel rechtstreeks via FFI.
  </Card>

  <Card title="VOICEVOX Core for PHP" href="/nl/packages/voicevox-core-php" icon="library">
    Bekijk de setup van de corebibliotheek en het gebruik aan de pure-PHP-kant.
  </Card>
</Columns>

## Referenties

* GitHub: [invokable/laravel-voicevox](https://github.com/invokable/laravel-voicevox)
* VOICEVOX Core for PHP: [/nl/packages/voicevox-core-php](/nl/packages/voicevox-core-php)
* VOICEVOX Core for PHP gebruiken: [/nl/packages/voicevox-core-php/usage](/nl/packages/voicevox-core-php/usage)
* PHP FFI: [/nl/advanced/ffi](/nl/advanced/ffi)
* De `tap()`-helper: [/nl/advanced/tap](/nl/advanced/tap)
* Officiële VOICEVOX-engine: [VOICEVOX/voicevox\_engine](https://github.com/VOICEVOX/voicevox_engine)


## Related topics

- [VoicevoxResponse - VOICEVOX for Laravel](/nl/packages/laravel-voicevox/response.md)
- [Configuratiereferentie - VOICEVOX for Laravel](/nl/packages/laravel-voicevox/configuration.md)
- [Clientmodus - presets - VOICEVOX for Laravel](/nl/packages/laravel-voicevox/client-presets.md)
- [VOICEVOX Core for PHP](/nl/packages/voicevox-core-php/index.md)
- [Clientmodus - gebruikerswoordenboek - VOICEVOX for Laravel](/nl/packages/laravel-voicevox/client-user-dict.md)
