Skip to main content
VOICEVOX for Laravel brings VOICEVOX speech synthesis features into Laravel. You can generate natural Japanese voice output from text.
Start with client mode for the fastest setup. If your environment supports FFI, you can move to native mode or engine API mode later.

Three usage modes

ModeRuntimeFFIBest forGuide
Client modeHTTP connection to official VOICEVOX engineNot requiredFirst trial, Docker environments, environments without FFIClient Talk / Client Song
Native modeDirect VOICEVOX CORE calls through PHP FFIRequiredBetter performance, offline use, CLI integrationNative Talk / Native Song
Engine API modeLaravel serves VOICEVOX-compatible API endpointsRequiredPublishing as an API server, multi-client integrationEngine Talk / Engine Song

Quick start

These steps cover client mode.
1

Install package(s)

composer require revolution/laravel-voicevox
See Installation and Configuration for full setup.
2

Start the official engine

docker pull voicevox/voicevox_engine:cpu-latest
docker run --rm -p '127.0.0.1:50021:50021' voicevox/voicevox_engine:cpu-latest
3

Try speech synthesis

use Revolution\Voicevox\Voicevox;

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

Core features

Speech synthesis (Talk)

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);

Singing synthesis (Song)

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);

User dictionary and presets

In client mode, use the Voicevox facade to manage the user dictionary and presets on the official engine side.
use Revolution\Voicevox\Voicevox;

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

$presetId = Voicevox::addPreset([
    'id' => 0,
    'name' => 'Slow and clear',
    '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

use Laravel\Ai\Audio;

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

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

Next steps

Last modified on May 26, 2026