PHPackages                             duncan3dc/sonos - 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. [API Development](/categories/api)
4. /
5. duncan3dc/sonos

ActiveLibrary[API Development](/categories/api)

duncan3dc/sonos
===============

Control Sonos speakers using a simple API

2.3.0(10mo ago)11015.1k39[8 issues](https://github.com/duncan3dc/sonos/issues)[2 PRs](https://github.com/duncan3dc/sonos/pulls)1Apache-2.0PHPPHP ^7.3 || ^8.0CI failing

Since May 29Pushed 4mo ago18 watchersCompare

[ Source](https://github.com/duncan3dc/sonos)[ Packagist](https://packagist.org/packages/duncan3dc/sonos)[ Docs](https://github.com/duncan3dc/sonos)[ RSS](/packages/duncan3dc-sonos/feed)WikiDiscussions main Synced 5d ago

READMEChangelogDependencies (19)Versions (98)Used By (1)

sonos
=====

[](#sonos)

A PHP library for interacting with [Sonos](http://www.sonos.com/) speakers.

Full documentation is available at
PHPDoc API documentation is also available at [http://duncan3dc.github.io/sonos/api/](http://duncan3dc.github.io/sonos/api/namespaces/duncan3dc.Sonos.html)

[![release](https://camo.githubusercontent.com/b81f05e1afa55fb5b0de3e2a98c85234150195d1b2bc0825693811636aa7d47e/68747470733a2f2f706f7365722e707567782e6f72672f64756e63616e3364632f736f6e6f732f76657273696f6e2e737667)](https://packagist.org/packages/duncan3dc/sonos)[![build](https://github.com/duncan3dc/sonos/workflows/.github/workflows/buildcheck.yml/badge.svg?branch=main)](https://github.com/duncan3dc/sonos/actions?query=branch%3Amain+workflow%3A.github%2Fworkflows%2Fbuildcheck.yml)[![coverage](https://camo.githubusercontent.com/1e9c288fc9e7157793c5cb1edd4ceae9b1720a4eb65a2d0842902d71e4962074/68747470733a2f2f636f6465636f762e696f2f67682f64756e63616e3364632f736f6e6f732f67726170682f62616467652e737667)](https://codecov.io/gh/duncan3dc/sonos)

Quick Examples
--------------

[](#quick-examples)

Start all groups playing music

```
$sonos = new \duncan3dc\Sonos\Network;
$controllers = $sonos->getControllers();
foreach ($controllers as $controller) {
    echo $controller->name . " (" . $controller->room . ")\n";
    echo "\tState: " . $controller->getState() . "\n";
    $controller->play();
}
```

Add all the tracks from one playlist to another

```
$sonos = new \duncan3dc\Sonos\Network;
$protest = $sonos->getPlaylistByName("protest the hero");
$progmetal = $sonos->getPlaylistByName("progmetal");

foreach ($protest->getTracks() as $track) {
    $progmetal->addTracks($track["uri"]);
}
```

*Read more at *

Changelog
---------

[](#changelog)

A [Changelog](CHANGELOG.md) has been available since version 0.8.8

Where to get help
-----------------

[](#where-to-get-help)

Found a bug? Got a question? Just not sure how something works?
Please [create an issue](//github.com/duncan3dc/sonos/issues) and I'll do my best to help out.
Alternatively you can catch me on [Twitter](https://twitter.com/duncan3dc)

duncan3dc/sonos for enterprise
------------------------------

[](#duncan3dcsonos-for-enterprise)

Available as part of the Tidelift Subscription

The maintainers of duncan3dc/sonos and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-duncan3dc-sonos?utm_source=packagist-duncan3dc-sonos&utm_medium=referral&utm_campaign=readme)

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance66

Regular maintenance activity

Popularity38

Limited adoption so far

Community28

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 96.5% 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 ~47 days

Recently: every ~227 days

Total

86

Last Release

309d ago

Major Versions

0.8.8 → 1.0.02014-12-30

1.9.x-dev → 2.0.02018-07-21

PHP version history (6 changes)0.0.1PHP &gt;=5.4.0

1.4.0PHP &gt;=5.5.0

1.7.0PHP &gt;=5.6.0

1.9.5PHP ^5.6|^7.0

2.0.0PHP ^7.1

2.2.0PHP ^7.3 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/11dc66042513f11d1c99b1e6763f25dca84a3ff31cdbea3972b9b804a3d3d5e9?d=identicon)[duncan3dc](/maintainers/duncan3dc)

---

Top Contributors

[![duncan3dc](https://avatars.githubusercontent.com/u/546811?v=4)](https://github.com/duncan3dc "duncan3dc (333 commits)")[![Nibbler73](https://avatars.githubusercontent.com/u/18286191?v=4)](https://github.com/Nibbler73 "Nibbler73 (2 commits)")[![fdp2](https://avatars.githubusercontent.com/u/7798051?v=4)](https://github.com/fdp2 "fdp2 (2 commits)")[![tobiaskluge](https://avatars.githubusercontent.com/u/2651934?v=4)](https://github.com/tobiaskluge "tobiaskluge (2 commits)")[![rlerdorf](https://avatars.githubusercontent.com/u/54641?v=4)](https://github.com/rlerdorf "rlerdorf (1 commits)")[![scottpashley](https://avatars.githubusercontent.com/u/16228214?v=4)](https://github.com/scottpashley "scottpashley (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![martinfobian](https://avatars.githubusercontent.com/u/1112243?v=4)](https://github.com/martinfobian "martinfobian (1 commits)")[![0bp](https://avatars.githubusercontent.com/u/586405?v=4)](https://github.com/0bp "0bp (1 commits)")[![PhilippKolmann](https://avatars.githubusercontent.com/u/156899705?v=4)](https://github.com/PhilippKolmann "PhilippKolmann (1 commits)")

---

Tags

phpsonosstreamingsonosupnp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/duncan3dc-sonos/health.svg)

```
[![Health](https://phpackages.com/badges/duncan3dc-sonos/health.svg)](https://phpackages.com/packages/duncan3dc-sonos)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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