PHPackages                             samvdb/php-musiccast-api - 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. samvdb/php-musiccast-api

ActiveLibrary

samvdb/php-musiccast-api
========================

PHP Wrapper for Yamaha MusicCast API

9425[2 issues](https://github.com/samvdb/php-musiccast-api/issues)[1 PRs](https://github.com/samvdb/php-musiccast-api/pulls)PHP

Since Aug 21Pushed 5y ago2 watchersCompare

[ Source](https://github.com/samvdb/php-musiccast-api)[ Packagist](https://packagist.org/packages/samvdb/php-musiccast-api)[ RSS](/packages/samvdb-php-musiccast-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yamaha MusicCast API PHP Library
================================

[](#yamaha-musiccast-api-php-library)

DEPRECATED!!!!
==============

[](#deprecated)

grandDam improved this library alot, it includes tests and more functionality.

Use [this fork](https://github.com/grandDam/php-musiccast-api) Library instead!

```
composer require granddam/php-musiccast-api
```

DEPRECATED!!!!
==============

[](#deprecated-1)

A simple wrapper for the Yamaha MusicCast API. Not all call's have been implemented yet so pull requests are welcome!

[![Build Status](https://camo.githubusercontent.com/ac1e8a8b0fd7157e69416748f80fdb473ee5ca32390a2333c6bc22e7acdc2be6/68747470733a2f2f7472617669732d63692e6f72672f73616d7664622f7068702d6d75736963636173742d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/samvdb/php-musiccast-api)

Based on the API specification found at [https://jayvee.com.au/downloads/commands/yamaha/YXC\_API\_Spec\_Basic.pdf](https://jayvee.com.au/downloads/commands/yamaha/YXC_API_Spec_Basic.pdf)

Updated API specs on 2017/04:

### Update

[](#update)

The API pdf's can also be found in this repository.

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

[](#requirements)

PHP &gt;= 5.6 Guzzle library, (optional) PHPUnit to run tests.

Install
-------

[](#install)

Download [Composer](https://getcomposer.org/)

```
$ curl -s http://getcomposer.org/installer | php
```

Via composer

```
$ composer require samvdb/php-musiccast-api php-http/guzzle6-adapter
```

You can install any adapter you want but guzzle is probably fine for what you want to do.

Creating a client
-----------------

[](#creating-a-client)

```
$yamaha = new MusicCast\Client([
    'host' => 'localhost',
    'port' => 80, // default value
]);
```

Using the API
-------------

[](#using-the-api)

```
$result = $yamaha->api('zone')->status('main');
print_r($result);
```

Enabling events
---------------

[](#enabling-events)

Yamaha can notify you directly in case of changes. The events are spread out as UDP unicast packets. In order to receive these packets you must subscribe every 10 minutes, else the subscription will expire.

Only the IP that requests the subscription will receive the events.

The default port is `41100`.

```
$yamaha->api('events')->subscribe();
```

### Using php sockets to read the events

[](#using-php-sockets-to-read-the-events)

Pretty easy using Clue's socket wrapper.

```
$ composer require clue/socket-raw
```

```
$factory = new \Socket\Raw\Factory();
$socket = $factory->createUdp4();
$socket->bind('0.0.0.0:41100');

while(true) {
    $data = $socket->read(5120);
    $result = json_decode($data, true);

    print_r($result);
}
```

Testing
-------

[](#testing)

```
$ composer test
```

Credits
-------

[](#credits)

This api is highly inspired by the excellent Github api client made by KnpLabs!

[KnpLabs/php-github-api](https://github.com/KnpLabs/php-github-api)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5eff09ad5fd745424b5dcdb9f2d6705a74ba76c9c4637d72248e0b622e299ac2?d=identicon)[samvdb](/maintainers/samvdb)

---

Top Contributors

[![samvdb](https://avatars.githubusercontent.com/u/632452?v=4)](https://github.com/samvdb "samvdb (3 commits)")

### Embed Badge

![Health badge](/badges/samvdb-php-musiccast-api/health.svg)

```
[![Health](https://phpackages.com/badges/samvdb-php-musiccast-api/health.svg)](https://phpackages.com/packages/samvdb-php-musiccast-api)
```

PHPackages © 2026

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