Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Voicevox Laravel Package

revolution/laravel-voicevox

Laravel wrapper for the VOICEVOX text-to-speech engine. Provides a simple client and configuration to synthesize Japanese speech, query speakers and styles, and integrate voice generation into Laravel applications via the VOICEVOX HTTP API.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. invokable/laravel-voicevox is a thin Laravel service-provider wrapper around the VOICEVOX Core native library, which it loads through PHP's FFI extension. It fits only where three constraints hold simultaneously: (1) the application runs PHP 8.x with the ffi extension enabled, (2) the host can carry the VOICEVOX Core shared libraries plus the ~1–2 GB of ONNX voice models on disk, and (3) synthesis happens on the same machine or container as the PHP process. It is a good fit for a self-hosted Laravel app that needs offline Japanese TTS (narration for articles, IVR prompts, accessibility readouts). It is a poor fit for stateless/serverless PHP, shared hosting, or any team unwilling to own native binary distribution.

Integration feasibility. Low integration surface, high environmental surface. The Laravel side is trivial — composer require, publish config, resolve the facade/manager, call audioQuery → synthesis. The real work is environment provisioning: FFI enablement, extension=ffi with ffi.enable=true (not preload-only), architecture-matched .so/.dll/.dylib, model directory layout, and voice model version alignment with the core. Release 0.2.0 does not change that integration contract — no API additions, removals, or deprecations are described.

Technical risk. The 0.2.0 delta is narrow: four Dependabot bumps to GitHub Actions (actions/checkout 6.0.3 → 7.0.0 → 7.0.1, qltysh/qlty-action/coverage 2.2.1 → 2.3.0) and one substantive change — VOICEVOX Core upgraded to v0.17.0 (PR #49, first contribution from @kawax). CI-action bumps are effectively zero product risk. The core upgrade is the only item requiring diligence: it changes the native ABI and, by convention with VOICEVOX releases, may alter available voice models, speaker/style metadata, or the on-disk model format. Because the package binds to core via FFI, a core version bump can break callers even when the PHP package API is unchanged. Secondary risks: the project is single-maintainer (bus factor 1), pre-1.0 (0.x semver permits breaking changes in minor bumps), and has a small contributor base — @kawax's PR is a first contribution, which is positive for velocity but means the upgrade path has not been exercised broadly.

Key questions. Does any application code pin a core or model version independent of the package? Are the bundled/downloaded voice models compatible with v0.17.0, or must models be re-fetched? Does core v0.17.0 change the dictionary/user-dict handling or the speaker/style ID space in a way that invalidates stored speaker IDs? Is the core binary shipped in the package artifact or fetched at install time, and is that reproducible in our build pipeline? What is our policy for 0.x dependencies with a single maintainer?

Integration Approach

Stack fit. Requires PHP 8.1+, Laravel 9/10/11/12 per the package's composer constraints, ext-ffi, and a Linux x86_64 (or supported-arch) container. Pairs naturally with a queue worker for asynchronous synthesis — TTS calls are CPU-bound for seconds at a time and should never run in a web request path. Storage fits Laravel's filesystem abstraction for caching generated WAVs keyed by text+speaker+params hash.

Migration path. We have no existing integration, so this is greenfield rather than migration. Sequence: pin invokable/laravel-voicevox at 0.2.0 exactly (not ^0.2) until we have verified the core v0.17.0 model/ABI surface; build a dedicated runtime image that bakes in FFI, the core shared library, and the pinned voice models; publish the package config and point it at that fixed model path. Do not rely on install-time downloads in production — vendor the binaries into the image so builds are hermetic and the core version is explicit.

Compatibility. Confirm the pinned core v0.17.0 and the model set match; VOICEVOX model/engine version skew is the most common failure mode in this ecosystem. Verify the PHP FFI setting is not disabled by the base image or by disable_functions. Validate on the exact target architecture — FFI struct layouts differ across platforms, and a container that differs from local dev (arm64 laptop vs amd64 prod) will fail at runtime, not at build time.

Sequencing. (1) Spike: synthesize one known phrase in a throwaway Laravel app on the target image, capturing cold-start time and memory. (2) Establish the version-pinning and image-vendoring policy. (3) Wrap the package behind our own TextToSpeech interface so the library is swappable for a cloud TTS provider if the native path proves operationally heavy. (4) Integrate via queued job with cached output. (5) Only then expose to product features. Re-run step (1) on every future core bump.

Operational Impact

Maintenance. The maintenance load is dominated by the native dependency, not the PHP package. Expect to track VOICEVOX core releases ourselves — 0.2.0 arrived as a community PR, which is a good sign but not a guarantee of cadence. Every core bump needs a re-validation of models and a rebuild of the runtime image; budget roughly a half-day per upgrade. Dependabot churn in CI is noise and can be largely ignored.

Support. No commercial support; upstream is a volunteer Japanese-language project, and this wrapper is a single-maintainer Laravel package. Escalation path is GitHub issues only. Mitigate by keeping our own integration thin and documented so we can fork or vendor the wrapper if it stalls. Language is a soft factor: much of the core's documentation and issue traffic is in Japanese.

Scaling. Synthesis is CPU-bound and memory-heavy (models are large and loaded per process). Horizontal scaling means replicating the model payload onto every worker — image size and cold-start cost are the real constraints, not throughput logic. Plan for a small pool of dedicated TTS workers with a queue, an output cache to avoid re-synthesizing identical text, and a concurrency limit tuned to available cores. This will not scale like an HTTP API call; capacity planning is per-core.

Failure modes. (a) FFI disabled or missing → hard failure at boot, easy to catch in CI. (b) Core/model version mismatch after an upgrade → runtime errors or corrupted/garbled audio, harder to catch, needs a smoke test with a golden audio hash. (c) OOM on workers when models load concurrently — set worker concurrency conservatively and add memory limits with alerting. (d) Speaker/style ID drift invalidating stored configuration. (e) Bus factor: upstream abandonment or a stalled security fix.

Ramp-up. A Laravel developer can integrate the happy path in under a day. Reaching production confidence takes one to two weeks, most of it spent on image construction, FFI/architecture validation, and queue and caching design rather than on the package itself. Recommend one engineer own the native-runtime concerns explicitly; treat "TTS runtime image" as a first-class owned artifact with a versioned, tested build, and add a golden-file audio regression test to CI so future core bumps surface breakage before deploy.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel