Skip to main content

Overview

revolution/voicevox-core is a pure PHP package that wraps VOICEVOX CORE’s C dynamic library via PHP FFI. VOICEVOX is a high-quality Japanese text-to-speech (TTS) engine, and this package lets you perform synthesis directly from PHP.
If you want to first review how PHP FFI works and its limitations, see PHP FFI.
If you’re working from a Laravel app, also read VOICEVOX for Laravel to compare the client and native modes.
PHP FFI is often disabled (ffi.enable=false) in web server environments such as FPM, so this package assumes use from a local CLI.

Requirements

  • PHP 8.3+
  • ext-ffi enabled
  • VOICEVOX CORE 0.16+

Installation

Library setup

To use this package, you need the VOICEVOX CORE dynamic library (.so / .dylib), the ONNX Runtime library, and the OpenJTalk dictionary.
1

Download voicevox_core

Download the downloader that matches your OS and architecture from the voicevox_core releases and run it. A voicevox_core directory is created in the current directory.The generated directory structure:
2

Move it to a permanent location

3

Create a symlink (recommended)

Create a symlink so the library can be located automatically.
Always use an absolute path with ln -s.
macOS:
If loading from /usr/local/lib/ fails, set DYLD_FALLBACK_LIBRARY_PATH in .zshrc or similar:
Linux:

Alternative: specifying via environment variable

If you can’t create a symlink, set the full path to the library file in the VOICEVOX_CORE_LIB_PATH environment variable:
On macOS, if loading still fails even with DYLD_FALLBACK_LIBRARY_PATH, set VOICEVOX_CORE_LIB_PATH instead.

Documentation

Usage

Basic usage and code samples for text-to-speech and audio synthesis.

API reference

Detailed reference for every class, method, and enum.
Last modified on August 2, 2026

Related topics

VOICEVOX Core for PHP