PHPackages                             revolution/voicevox-core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. revolution/voicevox-core

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

revolution/voicevox-core
========================

VOICEVOX Core

0.1.5(2mo ago)01.4k↑200%1MITPHP ^8.3

Since May 10Compare

[ Source](https://github.com/invokable/voicevox-core-php)[ Packagist](https://packagist.org/packages/revolution/voicevox-core)[ GitHub Sponsors](https://github.com/invokable)[ RSS](/packages/revolution-voicevox-core/feed)WikiDiscussions Synced 3w ago

READMEChangelogDependencies (3)Versions (7)Used By (1)

VOICEVOX Core for PHP
=====================

[](#voicevox-core-for-php)

[![tests](https://github.com/invokable/voicevox-core-php/actions/workflows/tests.yml/badge.svg)](https://github.com/invokable/voicevox-core-php/actions/workflows/tests.yml)[![integration tests](https://github.com/invokable/voicevox-core-php/actions/workflows/integration-tests.yml/badge.svg)](https://github.com/invokable/voicevox-core-php/actions/workflows/integration-tests.yml)[![linter](https://github.com/invokable/voicevox-core-php/actions/workflows/lint.yml/badge.svg)](https://github.com/invokable/voicevox-core-php/actions/workflows/lint.yml)[![Maintainability](https://camo.githubusercontent.com/a58631036b43f60ff6a386ca1f1e7c29c926a8e202ec10bca7b5c4aa00728959/68747470733a2f2f716c74792e73682f67682f696e766f6b61626c652f70726f6a656374732f766f696365766f782d636f72652d7068702f6d61696e7461696e6162696c6974792e737667)](https://qlty.sh/gh/invokable/projects/voicevox-core-php)[![Code Coverage](https://camo.githubusercontent.com/b53be391e0b86e2e049023ccac5016c674b7d1f7952f95a6e50a2ef99da41434/68747470733a2f2f716c74792e73682f67682f696e766f6b61626c652f70726f6a656374732f766f696365766f782d636f72652d7068702f636f7665726167652e737667)](https://qlty.sh/gh/invokable/projects/voicevox-core-php)[![Ask DeepWiki](https://camo.githubusercontent.com/0f5ae213ac378635adeb5d7f13cef055ad2f7d9a47b36de7b1c67dbe09f609ca/68747470733a2f2f6465657077696b692e636f6d2f62616467652e737667)](https://deepwiki.com/invokable/voicevox-core-php)

PHP FFI wrapper for [VOICEVOX CORE](https://github.com/VOICEVOX/voicevox_core) — the text-to-speech engine library from the VOICEVOX project.

This is a package for pure PHP. For general use, the [Laravel version](https://github.com/invokable/laravel-voicevox) is recommended.

Requirements
------------

[](#requirements)

- PHP 8.3+
- `ext-ffi` extension enabled
- VOICEVOX CORE 0.16+

Note

PHP FFI is typically disabled in web server environments (e.g., FPM with `ffi.enable=false`). This library is intended for **local CLI use only**.

Installation
------------

[](#installation)

```
composer require revolution/voicevox-core
```

Library Setup (Linux / macOS)
-----------------------------

[](#library-setup-linux--macos)

This package requires the VOICEVOX CORE dynamic library (`.so` / `.dylib`), the ONNX Runtime library, and the OpenJTalk dictionary.

### 1. Download voicevox\_core

[](#1-download-voicevox_core)

Download the appropriate downloader for your OS and architecture from [voicevox\_core releases](https://github.com/VOICEVOX/voicevox_core/releases) and run it. This creates a `voicevox_core` directory in the current directory containing:

- `dict/open_jtalk_dic_*/` — OpenJTalk dictionary
- `c_api/lib/` — Dynamic library file (`.so`, `.dylib`, or `.dll`)
- `models/` — compressed model files (`.vvm`)
- `onnxruntime/` — ONNX Runtime library

### 2. Move to a permanent location

[](#2-move-to-a-permanent-location)

```
mv voicevox_core ~/.local/voicevox_core
```

### 3. Create a symlink (Recommended)

[](#3-create-a-symlink-recommended)

Create a symlink so the library can be found automatically:

**macOS:**

```
# Replace [VOICEVOX_CORE_DIR] with the absolute path to voicevox_core
ln -s [VOICEVOX_CORE_DIR]/libvoicevox_core.dylib /usr/local/lib/libvoicevox_core.dylib
```

If you cannot load from `/usr/local/lib/`, set `DYLD_FALLBACK_LIBRARY_PATH` in your `.zshrc` file or similar.

```
export DYLD_FALLBACK_LIBRARY_PATH="$HOME/lib:/usr/local/lib:/usr/lib"
```

**Linux:**

```
ln -s [VOICEVOX_CORE_DIR]/libvoicevox_core.so /usr/local/lib/libvoicevox_core.so
```

Warning

Always use **absolute paths** when using `ln -s`.

### Alternative: Environment variable

[](#alternative-environment-variable)

If you cannot create a symlink, set the `VOICEVOX_CORE_LIB_PATH` environment variable to the full path of the library file:

```
export VOICEVOX_CORE_LIB_PATH=/path/to/libvoicevox_core.dylib
```

```
export VOICEVOX_CORE_LIB_PATH="$HOME/.local/voicevox_core/c_api/lib/libvoicevox_core.dylib"
```

Usage Example
-------------

[](#usage-example)

The following `talk.php` demonstrates text-to-speech synthesis:

```
