Documentation

Speaker
in package
implements SpeakerInterface

FinalYes

Represents an individual Sonos speaker, to allow volume, equalisation, and other settings to be managed.

Table of Contents

Interfaces

SpeakerInterface
Represents an individual Sonos speaker, to allow volume, equalisation, and other settings to be managed.

Properties

$coordinator  : bool
$device  : DeviceInterface
$group  : string|null
$ip  : string

Methods

__construct()  : mixed
Create an instance of the Speaker class.
adjustVolume()  : $this
Adjust the volume of this speaker by a relative amount.
getBass()  : int
Get the bass equalisation level.
getGroup()  : string
Get the uuid of the group this speaker is a member of.
getIndicator()  : bool
Check whether the indicator light is on or not.
getIp()  : string
Get the IP address of this speaker.
getLoudness()  : bool
Check whether loudness normalisation is on or not.
getName()  : string
Get the "Friendly" name of this speaker.
getRoom()  : string
Get the room name of this speaker.
getTreble()  : int
Get the treble equalisation level.
getUuid()  : string
Get the uuid of this speaker.
getVolume()  : int
Get the current volume of this speaker.
isCoordinator()  : bool
Check if this speaker is the coordinator of it's current group.
isMuted()  : bool
Check if this speaker is currently muted.
mute()  : $this
Mute this speaker.
setBass()  : $this
Set the bass equalisation.
setGroup()  : void
Set which group this speaker belongs to.
setIndicator()  : $this
Turn the indicator light on or off.
setLoudness()  : $this
Set whether loudness normalisation is on or not.
setTreble()  : $this
Set the treble equalisation.
setVolume()  : $this
Adjust the volume of this speaker to a specific value.
soap()  : SoapResponse
unmute()  : $this
Unmute this speaker.
updateGroup()  : void
Remove any previously established group for this speaker.
lookupTopology()  : void
Ensure we've determined this speaker's topology.
setEqLevel()  : $this
Set the bass/treble equalisation level.

Properties

$coordinator

private bool $coordinator = false

Whether this speaker is the coordinator of its group or not.

$group

private string|null $group = null

The group id this speaker is a part of.

$ip

private string $ip

The IP address of the speaker.

Methods

__construct()

Create an instance of the Speaker class.

public __construct(DeviceInterface|string $param) : mixed
Parameters
$param : DeviceInterface|string

An Device instance or the ip address that the speaker is listening on

adjustVolume()

Adjust the volume of this speaker by a relative amount.

public adjustVolume(int $adjust) : $this
Parameters
$adjust : int

The amount to adjust by between -100 and 100

Return values
$this

getBass()

Get the bass equalisation level.

public getBass() : int
Return values
int

getGroup()

Get the uuid of the group this speaker is a member of.

public getGroup() : string
Tags
inheritDoc
Return values
string

getIndicator()

Check whether the indicator light is on or not.

public getIndicator() : bool
Return values
bool

getIp()

Get the IP address of this speaker.

public getIp() : string
Return values
string

getLoudness()

Check whether loudness normalisation is on or not.

public getLoudness() : bool
Return values
bool

getName()

Get the "Friendly" name of this speaker.

public getName() : string
Return values
string

getRoom()

Get the room name of this speaker.

public getRoom() : string
Return values
string

getTreble()

Get the treble equalisation level.

public getTreble() : int
Return values
int

getUuid()

Get the uuid of this speaker.

public getUuid() : string
Return values
string

getVolume()

Get the current volume of this speaker.

public getVolume() : int
Return values
int

isCoordinator()

Check if this speaker is the coordinator of it's current group.

public isCoordinator() : bool
Return values
bool

isMuted()

Check if this speaker is currently muted.

public isMuted() : bool
Return values
bool

mute()

Mute this speaker.

public mute([bool $mute = true ]) : $this
Parameters
$mute : bool = true

Whether the speaker should be muted or not

Return values
$this

setBass()

Set the bass equalisation.

public setBass(int $bass) : $this
Parameters
$bass : int

The bass level (between -10 and 10)

Return values
$this

setGroup()

Set which group this speaker belongs to.

public setGroup(string $group) : void
Parameters
$group : string
Tags
inheritDoc

setIndicator()

Turn the indicator light on or off.

public setIndicator(bool $on) : $this
Parameters
$on : bool

Whether the indicator should be on or off

Return values
$this

setLoudness()

Set whether loudness normalisation is on or not.

public setLoudness(bool $on) : $this
Parameters
$on : bool

Whether loudness should be on or not

Return values
$this

setTreble()

Set the treble equalisation.

public setTreble(int $treble) : $this
Parameters
$treble : int

The treble level (between -10 and 10)

Return values
$this

setVolume()

Adjust the volume of this speaker to a specific value.

public setVolume(int $volume) : $this
Parameters
$volume : int

The amount to set the volume to between 0 and 100

Return values
$this

soap()

public soap(string $service, string $action[, array<string|int, mixed> $params = [] ]) : SoapResponse
Parameters
$service : string
$action : string
$params : array<string|int, mixed> = []
Return values
SoapResponse

unmute()

Unmute this speaker.

public unmute() : $this
Return values
$this

updateGroup()

Remove any previously established group for this speaker.

public updateGroup() : void
Tags
inheritDoc

lookupTopology()

Ensure we've determined this speaker's topology.

private lookupTopology() : void

setEqLevel()

Set the bass/treble equalisation level.

private setEqLevel(string $type, int $value) : $this
Parameters
$type : string

Which setting to update (bass or treble)

$value : int

The value to set (between -10 and 10)

Return values
$this
On this page

Search results