discord-php-helpers/voice
Voice support for DiscordPHP. Requires PHP 8.3+, ext-json, and familiarity with event loops and promises. Supports DAVE end-to-end encryption with ext-ffi and libdave, plus documented audio pipeline and protocol references.
playFile() for music/TTS/announcement bots, record() with RecordingFormat::PCM for custom pipelines, WAV for turnkey per-user files, OGG for storage-efficient archival. Recording per-user is a meaningful unlock for transcription, meeting notes, moderation evidence, and accessibility features.ext-ffi + libdave being non-negotiable at runtime — with no fallback to protocol version 0. This is a hard gate, not a nice-to-have, and it should be reflected in infra planning rather than discovered in QA.Consider it when all of the following hold:
ext-ffi, vendor libdave (the bundled setup-libdave.sh handles Linux/macOS/Windows on x64 and ARM64), and install ffmpeg / libsodium.VoiceException marker interface for unified error handling, and CI running PHPStan, mutation testing, and coverage — that is a better engineering hygiene story than most 3-star repositories.Look elsewhere when:
@discordjs/voice), Python, or Go have orders of magnitude more production voice usage, tutorials, and community answers. Choosing PHP for a greenfield voice product is a decision that needs a strong reason.To executives: This is the only maintained path to Discord voice channels in PHP, and it handles the hard part — the newly mandatory DAVE end-to-end encryption protocol — so we don't build cryptography and real-time audio from scratch. That is a substantial avoided engineering cost and a compliance box we cannot skip. The trade-off is real: it adds native runtime dependencies, constrains where we can host, and comes from a small maintainer community with limited production track record. Recommendation: adopt it if voice is a genuine differentiator and we already run DiscordPHP; otherwise, either defer the voice roadmap or treat the language choice as the decision to revisit.
To engineering: It's an async, event-loop library — not a Laravel-style package with service providers or facades. Plan for a long-running worker process, ext-ffi + a vendored libdave built via setup-libdave.sh, ffmpeg and libsodium in the image, and PHP 8.3+. Pin versions aggressively; the package moves in small patch releases aligned to DiscordPHP v8. Wrap all voice calls in a single VoiceException handler, and add monitoring around the LibDaveNotFoundException path — that failure mode is environmental, not logical, and it will bite us in deploy, not in tests. Budget real onboarding time for promises and the event loop before anyone writes voice code.
How can I help you explore Laravel packages today?