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

# Installatie en configuratie - VOICEVOX for Laravel

> Uitleg over de installatie van VOICEVOX for Laravel, installatie met of zonder FFI, het configuratiebestand, .env en het voorbereiden van engine-resources.

## Wat installeer je

Welke extra pakketten en lokale setup je nodig hebt voor VOICEVOX for Laravel, hangt af van de modus die je wilt gebruiken.

> [tab] Alleen client
>
> Als je alleen via HTTP verbinding maakt met de officiële VOICEVOX-engine, kun je beginnen met enkel `revolution/laravel-voicevox`.
>
> ```shell theme={null}
> composer require revolution/laravel-voicevox
> ```

> [tab] Ook native / Engine API gebruiken
>
> Voor modi die FFI gebruiken installeer je ook `revolution/voicevox-core`.
>
> ```shell theme={null}
> composer require revolution/laravel-voicevox revolution/voicevox-core
> ```

## Vereisten

| Onderdeel | Inhoud |
| - | - |
| PHP | 8.3+ |
| Laravel | 12+ |
| Vereiste extensie | `ext-zip` |
| FFI `ext-ffi` | Nodig voor native modus / Engine API |

> [!WARNING]
>
> Op gangbare webservers, waaronder Laravel Cloud, is FFI uitgeschakeld. Probeer de native modus en de Engine API in een **lokale CLI**.

## Installatiestappen

**1. Installeer het pakket**

Installeer via Composer, afhankelijk van de modus die je wilt gebruiken. Voor de native modus en de Engine API heb je ook [VOICEVOX Core for PHP](https://kawax.biz/nl/packages/voicevox-core-php.md) nodig.

**2. Publiceer het configuratiebestand**

```shell theme={null}
php artisan vendor:publish --tag="voicevox-config"
```

**3. Stel .env in**

Gebruik je alleen de clientmodus, stel dan `VOICEVOX_URL` in; gebruik je FFI, stel dan `VOICEVOX_CORE_PATH` in.

**4. Installeer indien nodig engine-resources**

Als je `/speaker_info` of `/singer_info` gebruikt, zijn extra resources nodig.

## `config/voicevox.php`

Alle configuratieopties vind je in de [configuratiereferentie](https://kawax.biz/nl/packages/laravel-voicevox/configuration.md).

```php theme={null}
return [
    'client' => [
        'url' => env('VOICEVOX_URL', 'http://127.0.0.1:50021'),
        'core_version' => env('VOICEVOX_CLIENT_CORE_VERSION'),
    ],

    'core' => [
        'path' => env('VOICEVOX_CORE_PATH'),
        'dict' => env('VOICEVOX_CORE_DICT_PATH', 'dict/open_jtalk_dic_utf_8-1.11'),
        'models' => env('VOICEVOX_CORE_MODELS_PATH', 'models/vvms'),
        'vvms' => ['0.vvm', '9.vvm', 's0.vvm'],
    ],

    'engine' => [
        'disabled' => env('VOICEVOX_ENGINE_DISABLED', false),
        'fallback_url' => env('VOICEVOX_ENGINE_FALLBACK_URL', 'http://127.0.0.1:50021'),
    ],
];
```

## Minimaal benodigde `.env`

### Alleen clientmodus

Als je de officiële engine start op de standaard `http://127.0.0.1:50021`, is geen extra configuratie nodig.

```dotenv theme={null}
VOICEVOX_URL=http://127.0.0.1:50021
```

### Native modus / Engine API

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

> [!NOTE]
>
> De inhoud van `VOICEVOX_CORE_PATH` bereid je voor volgens de stappen van [VOICEVOX Core for PHP](https://kawax.biz/nl/packages/voicevox-core-php.md). Raadpleeg daar ook de plaatsing van de bibliotheek zelf, het OpenJTalk-woordenboek en de modelbestanden.

## FFI inschakelen

In de CLI werkt het meestal direct.

Als je de Laravel-versie van de Engine API lokaal start, schakel je FFI in via `php.ini`.

```ini theme={null}
ffi.enable=true
```

Hoe FFI werkt en welke beperkingen er zijn, vind je in [PHP FFI](https://kawax.biz/nl/advanced/ffi.md).

## Engine-resources installeren

Als je resource-endpoints zoals `/speaker_info` of `/singer_info` gebruikt, installeer je apart de resourcebestanden.

```shell theme={null}
php artisan voicevox:install
```

In een Orchestra Testbench-omgeving gebruik je dit commando:

```shell theme={null}
vendor/bin/testbench voicevox:install
```

## Ingang per modus

> [card] [Client Talk](https://kawax.biz/nl/packages/laravel-voicevox/client-talk.md)
>
> Start de officiële VOICEVOX-engine met Docker en synthetiseer tekst naar spraak.

> [card] [Client Song](https://kawax.biz/nl/packages/laravel-voicevox/client-song.md)
>
> Synthetiseer zang met `Score` en `Note`.

> [card] [Native Talk](https://kawax.biz/nl/packages/laravel-voicevox/native-talk.md)
>
> Roep VOICEVOX CORE rechtstreeks aan via FFI.

> [card] [Native Song](https://kawax.biz/nl/packages/laravel-voicevox/native-song.md)
>
> Bekijk zangmodellen en wanneer je `sync()` gebruikt.

## Referentielinks

* [Overzicht van VOICEVOX for Laravel](https://kawax.biz/nl/packages/laravel-voicevox.md)
* [Aan de slag](https://kawax.biz/nl/packages/laravel-voicevox/getting-started.md)
* [Configuratiereferentie](https://kawax.biz/nl/packages/laravel-voicevox/configuration.md)
* [VOICEVOX Core for PHP](https://kawax.biz/nl/packages/voicevox-core-php.md)
* [VOICEVOX Core for PHP gebruiken](https://kawax.biz/nl/packages/voicevox-core-php/usage.md)
* [PHP FFI](https://kawax.biz/nl/advanced/ffi.md)


## Related topics

- [Laravel Cashier (Stripe)](https://kawax.biz/nl/cashier.md)
- [Score en Note in detail - VOICEVOX for Laravel](https://kawax.biz/nl/packages/laravel-voicevox/song-score-note.md)
- [VOICEVOX for Laravel](https://kawax.biz/nl/packages/laravel-voicevox/index.md)
- [Aan de slag - VOICEVOX for Laravel](https://kawax.biz/nl/packages/laravel-voicevox/getting-started.md)
- [Engine-API-modus: talk (tekst-naar-spraak) - VOICEVOX for Laravel](https://kawax.biz/nl/packages/laravel-voicevox/engine-talk.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.