PHPackages                             danog/php-rtc-opus - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. danog/php-rtc-opus

ActiveLibrary

danog/php-rtc-opus
==================

Lazy libopus FFI bindings for PHP audio encoding and decoding. MadelineProto's PHP 8.2+ fork keeps FFI optional within the modular danog/php-rtc stack.

v1.0.1005(today)018↑2566.7%1BSD-3-ClausePHPPHP ^8.2CI passing

Since May 12Pushed todayCompare

[ Source](https://github.com/danog/php-rtc-opus)[ Packagist](https://packagist.org/packages/danog/php-rtc-opus)[ Docs](https://github.com/danog/php-rtc-opus)[ GitHub Sponsors](https://github.com/php-webrtc)[ RSS](/packages/danog-php-rtc-opus/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (8)Used By (1)

Opus Adapter for PHP
====================

[](#opus-adapter-for-php)

[![PHP Version](https://camo.githubusercontent.com/c5e8da782b1a0673c08b4f474108036d2cc973470eed2d5d89d48e8c8475eee6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d626c75652e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/2b599ab1ace97388d4375b87919f92781a1a61d016fe640a5c4d15fc365deed1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4253442d626c75652e737667)](LICENSE)

**Deprecation Notice:** This library will be replaced with the [AV library](https://github.com/php-webrtc/av) in a future update.

A lightweight PHP wrapper for the [libopus](https://opus-codec.org/) audio codec using PHP FFI.
This package provides encoder and decoder classes for working with raw PCM audio and the Opus format.

About this fork
---------------

[](#about-this-fork)

This is the `danog/php-rtc-opus` fork used by MadelineProto. It targets PHP 8.2+, loads and publishes the libopus FFI binding lazily after validating the native library, and therefore does not require FFI merely to install the wider WebRTC stack.

All internal Composer dependencies use their `danog/php-rtc-*` package names directly, so installing a component selects the maintained danog packages throughout the dependency graph.

Features
--------

[](#features)

- Encode raw PCM audio to Opus format
- Decode Opus-encoded audio back to PCM
- Based on FFI bindings to the native libopus library
- Compatible with multi-channel and variable sample rate audio

Requirements
------------

[](#requirements)

- PHP ≥ 8.2
- FFI and libopus only when encoding or decoding audio
- Linux environment (Windows/macOS support planned)

Documentation
-------------

[](#documentation)

This package is part of the PHP WebRTC library. For complete documentation, examples, and API reference, visit:

[PHP WebRTC Documentation](https://github.com/danog/php-rtc-opus)

Credits
-------

[](#credits)

### Authors

[](#authors)

- **Amin Yazdanpanah**
    [aminyazdanpanah.com](https://www.aminyazdanpanah.com)
- **Sana Moniri**
    [GitHub](https://github.com/sanamoniri)

Reporting Issues
----------------

[](#reporting-issues)

Found a bug? Please report it on our [issues](https://github.com/php-webrtc/opus/issues).

License
-------

[](#license)

BSD 3-Clause License. See [LICENSE](LICENSE) for details.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance100

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~78 days

Recently: every ~8 days

Total

7

Last Release

0d ago

PHP version history (2 changes)v1.0.0PHP ^8.4

v1.0.1000PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1586cd637028e4f8da85f2252b8f4b81e05f6b17a93f92c34ff064dd838e6bb?d=identicon)[danog](/maintainers/danog)

---

Top Contributors

[![danog](https://avatars.githubusercontent.com/u/7339644?v=4)](https://github.com/danog "danog (9 commits)")

---

Tags

opuslibopus

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/danog-php-rtc-opus/health.svg)

```
[![Health](https://phpackages.com/badges/danog-php-rtc-opus/health.svg)](https://phpackages.com/packages/danog-php-rtc-opus)
```

###  Alternatives

[kiwilan/php-audio

PHP package to parse and update audio files metadata, with `JamesHeinrich/getID3`.

3116.6k1](/packages/kiwilan-php-audio)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
