Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
汇总 VOICEVOX for Laravel 的基本概念、三种模式的对比、快速开始(客户端模式)与主要功能。
安装包
composer require revolution/laravel-voicevox
启动官方引擎
docker pull voicevox/voicevox_engine:cpu-latest docker run --rm -p '127.0.0.1:50021:50021' voicevox/voicevox_engine:cpu-latest
尝试语音合成
use Revolution\Voicevox\Voicevox; $response = Voicevox::talk('こんにちは、Laravel です。', id: 1)->generate(id: 1); $response->storeAs('output.wav');
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);
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);
Voicevox
use Revolution\Voicevox\Voicevox; $uuid = Voicevox::addWord( surface: 'Laravel', pronunciation: 'ララベル', accentType: 3, ); $presetId = Voicevox::addPreset([ 'id' => 0, 'name' => 'ゆっくり丁寧', '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, ]);
use Laravel\Ai\Audio; $audio = Audio::of('こんにちは、Laravel です。') ->voice('ずんだもん') ->generate(); $audio->storeAs('output.wav');
相关主题
此页面对您有帮助吗?