Download the PHP package sabinus52/soundtouchapi without Composer

On this page you can find all versions of the php package sabinus52/soundtouchapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package soundtouchapi

SoundTouchApi

SoundTouchApi is a PHP Library that allows you to interact with Bose SoundTouch speakers. It allows you to integrate control into your own PHP applications or domotic box.

Installation

For install the package with composer :

composer require sabinus52/soundtouchapi
composer install

Usage

require __DIR__ . '/vendor/autoload.php';

use Sabinus\SoundTouch\SoundTouchApi;
use Sabinus\SoundTouch\Component\ContentItem;
use Sabinus\SoundTouch\Constants\Source;
use Sabinus\SoundTouch\Constants\Key;

// Initialize object API
$api = new SoundTouchApi('192.168.0.1');

// Get informations
$info = $api->getInfo();
print 'DeviceID : '.$info->getDeviceID()."\n";
print 'Nom : '.$info->getName()."\n";

// Get now playing
$result = $api->getNowPlaying();
print 'Source : '.$result->getSource()."\n";

// Volume
$volume = $api->getVolume();
print 'Volume : '.$volume->getActual()."\n";
print 'Mute : '.$volume->isMuted()."\n";
$api->setVolume(27); // Set new volume 0..100
$api->mute(); // Cut volume

// Select source BLUETOOTH
$source = new ContentItem();
$source->setSource(Source::BLUETOOTH);
$api->selectSource($source);

// Select station radio TUNEIN
$source = new ContentItem();
$source->setSource(Source::TUNEIN)
    ->setType('stationurl')
    ->setLocation('/v1/playback/station/s17695')
    ->setName('FG Radio FG')
    ->setImage('http://cdn-radiotime-logos.tunein.com/s17695q.png');
$api->selectSource($source);

// Send Command pause music
$api->setKey(Key::PAUSE);
$result = $api->getNowPlaying();
print 'Track : '.$result->getTrack()."\n";
print 'Artist : '.$result->getArtist()."\n";

// List of the sources
$result = $api->getSources();
foreach ($result as $key => $source) {
    print $key.' : '.$source->getName().' / '.$source->getSource()."\n";
}

// Liste of presets
$result = $api->getPresets();
foreach ($result as $preset) {
    print 'Preset '.$preset->getId().' : '.$preset->getContentItem()->getSource().' / '.$preset->getContentItem()->getName()."\n";
}

// Play preset No. 1
$api->playPreset(1);

// Set current source as preset No. 5
$api->setPreset(5);

MutiRoom

require __DIR__ . '/vendor/autoload.php';

use Sabinus\SoundTouch\SoundTouchApi;
use Sabinus\SoundTouch\Component\ContentItem;
use Sabinus\SoundTouch\Constants\Source;
use Sabinus\SoundTouch\Constants\Key;

// Initialize object API
$api = new SoundTouchApi('192.168.0.1');

// Create zone
$zone = new Zone();
$zone->setMaster('ABCD123456')->setSender('192.168.0.1');
$slave1 = new ZoneSlave();
$slave1->setMacAddress('111ABCDEF')->setIpAddress('192.168.0.2');
$slave2 = new ZoneSlave();
$slave2->setMacAddress('222ABCDEF')->setIpAddress('192.168.0.3');
$zone->setSlaves( [ $slave1, $slave2 ] );
$api->setZone($zone);

// Remove slave
$api->removeZoneSlave($slave2);
// Add slave
$api->addZoneSlave($slave2);

Jeedom

A specific class to integrate control into Jeedom. (More features)

See my Jeedom plugin : https://github.com/sabinus52/jeedom-bose-soundtouch

Example :

use Sabinus\SoundTouch\JeedomSoundTouchApi;

$speaker = new JeedomSoundTouchApi('soundtouch');

// Power ON
$speaker->powerOn();

// Select BlueTooth
$speaker->selectBlueTooth();
$status = $speaker->getNowPlaying();
print 'Source : '.$status->getSource()."\n";
print 'Track : '.$status->getTrack()."\n";
print 'Artist : '.$status->getArtist()."\n";
$speaker->play();
$speaker->nextTrack();
$status = $speaker->getNowPlaying(true); // Refresh status
print 'Track : '.$status->getTrack()."\n";
print 'Artist : '.$status->getArtist()."\n";

// Select source HDMI
$speaker->selectHDMI();

// Display volume and change it
print 'Volume Actual : '.$speaker->getLevelVolume()."\n";
print 'Mute : '.$speaker->isMuted()."\n";
$speaker->setVolume(27);
print 'New volume : '.$speaker->getLevelVolume(true)."\n";

All versions of soundtouchapi with dependencies

PHP Build Version
Package Version
Requires php Version ^5.2||^7
guzzlehttp/guzzle Version ^6.5.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sabinus52/soundtouchapi contains the following files

Loading the files please wait ...