PHP code example of djsoftnet / radioboss-php-api

1. Go to this page and download the library: Download djsoftnet/radioboss-php-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

djsoftnet / radioboss-php-api example snippets




nt = new \RadioBoss\RadioBossAPIClient("127.0.0.1", "9000");
$api = new \RadioBoss\RadioBossAPI($client);

    $track->getArtist();
    $track->getTitle();
    $track->getDuration();
    

    $api->getPlaybackInfo()->getCurrentTrack();
    

    $api->getPlaybackInfo()->getNextTrack();
    

    $api->getPlaybackInfo()->getPreviousTrack();
    

    //all last played songs
    $api->getLastPlayed();
    //filters out songs that were not sent to the server
    $api->getLastPlayed(true);
    

    $api->getTrackArtwork();
    $api->getNextTrackArtwork();
    

    $api->setNextTack(123);
    

    $api->readTag("C:\Music\song.mp3");
    

    $playlist->getTracks();
    $playlist->getCount();
    

    //all songs
    $api->getPlaylist();
    //only songs from 5-10
    $api->getPlaylist(5, 10);
    

    //all songs
    $api->getPlaylist2();
    //only songs the first 10 songs
    $api->getPlaylist2(10);
    

    $api->getMicrophone();
    

    $api->setMicrophone(true);
    $api->setMicrophone(false);
    

    $playback->getPosition();
    $playback->getLength();
    $playback->getState();
    

    $api->getPlaybackInfo()->getPlayback();
    

    $encoder->getStatus();
    $encoder->getError();
    

    $api->getEncoderStatus();
    

    $player->getVersion();
    $player->getUptime();
    

    $api->getStatus();