What is native mode?
Native mode uses VOICEVOX Core for PHP to call VOICEVOX CORE directly through PHP FFI. You can synthesize without starting the official engine, but you need FFI and a local library setup.Prerequisites
- Complete installation and setup.
- Complete the setup for VOICEVOX Core for PHP.
- Set
VOICEVOX_CORE_PATHin.env.
Basic usage
In native mode, use thetalk() helper.
Specifying a style ID
Setid to a style ID contained in a loaded .vvm.
core.vvms in config/voicevox.php can be used.
Adjusting the Audio Query with tap()
tap() works the same way in native mode. Note, though, that TalkAudioQuery is a different class from the one in client mode.
The
tap() pattern itself is summarized in The tap() helper and the Tappable trait. VOICEVOX for Laravel is a practical example of it.Using AquesTalk-style kana
Native mode has noenable_katakana_english, so it isn’t suited to reading input that mixes in English.
Use kana() instead to pass AquesTalk-style kana directly.
Streaming synthesis
stream() follows the same spec as /streaming_synthesis in VOICEVOX Engine 0.26.0 and returns a TalkStream that outputs the WAV from the beginning in order. Only styles of type streaming_talk (VVM v2 format) are supported.
stream() throws an InvalidArgumentException when startOffset is greater than or equal to the audio length. Under the hood it renders the VOICEVOX Core AudioFeature segment by segment. See VOICEVOX Core for PHP usage for details.
Differences from client mode
Next pages
Native Song
Work with singing voice models through FFI.
VOICEVOX Core for PHP
Set up the pure PHP wrapper and understand its constraints.