Sonos A PHP library for interacting with Sonos speakers

Getting Started

Usage

Controllers

Services

Fun Stuff

Speakers

View the API Documentation for this class

Most actions related to speakers take place on Controllers, but there are a few that should be handled via speakers.

Get some information about a speaker:

# Get the IP address of the speaker
$speaker->getIp();

# Get the "Friendly" name reported by the speaker (spoiler: it's not that friendly)
$speaker->getName();

# Get the room name assigned to this speaker
$speaker->getRoom();

Manage the volume of a speaker:

if ($speaker->getVolume() > 50) {
    $speaker->setVolume(50);
}

$speaker->adjustVolume(10);
$speaker->adjustVolume(-10);

Mute a speaker:

$speaker->mute();

if ($speaker->isMuted()) {
    $speaker->unmute();
}

Manage the equalisation of a speaker:

if ($speaker->getTreble() > -5) {
    $speaker->setTreble(-5);
}
if ($speaker->getBass() < 5) {
    $speaker->setBass(5);
}

if (!$speaker->getLoudness()) {
    $speaker->setLoudness(true);
}