How to get “Now Playing” metadata on the website of the radio station

This is a guest post by Richard Isaacs – Digital Content Assistant of Fresh 92.7

This is a simple tutorial for generating the artist and title from your ACRCloud JSON stream now plating metadata for a standard online radio audio stream being monitored using the ACRCloid Broadcast Monitoring function.

  1. To begin you will need to set up your ARC account and set up your audio stream. You can get a free trial account at here.
  2. Once you are set up you can access your console at here and use the instructions at here to set up your first radio stream for monitoring.
  3. Once you have your stream reading and set up the results will be available in your console as in Step 3 of the tutorial linked above. But, how can you show the results on your website? The following is one method I use which uses some basic PHP functions and a simple shortcode plugin.Note 1 you do not have to use the shortcode plugin, shortcodes can be hardcoded into your root files such as the functions PHP file of a WordPress theme/child theme but this is simpler and available via the standard WordPress login and doesn’t require FTP or similar secure access.

    Note 2 if you do want to start using a plugin like this be very careful, poorly written or untested PHP placed on your site can at least render some pages poorly or at worst crash your site. Always test your PHP on a development or localhost site before using it on a live site. Unlike javascript or JQuery or similar client side languages, PHP is a server language so if it isn’t written right it can cause you much greater issues and can’t just be ignored by a user’s browser.

  4. It always pays to create a site backup and database backup before writing any PHP code or installing any new plugins. Once done, locate a suitable shortcode plugin creator from the WordPress plugins database and ensure it can run PHP and is compatible with your current WordPress installation and PHP version.
    I have used ShortCodes UI in the past but it is now out of date and will be finding an alternative shortly.
  5. Now you will need your radio ACRCloud JSON stream URL. Use this tutorial to find your stream.Your stream will look something like this
    Explanation of above string URL this is the standard stream URL for monitoring
    s-bVX73QK/ this is the ARCCloud stream ID available from your ACRCloud account once set up in the console as at step 2 above
    results?access_key= enter this is to allow it to run the key in order to access the data
    4709cb1d4bf05a8e782034797fxxxxxx this is the key linked with the stream id above. The key can be found in the console under the Broadcast Monitoring tab on the left in your ACRCloud console.
    Once you have your plugin installed find the PHP option in the shortcode generator for a new shortcode (see example below) and create shortcodes using the codes available at this gist on Github.
    example PHP input

Then once you have your shortcodes you can place them anywhere on your site to call the results.
[Artist] – [Track]

Check the PHP results at the bottom of the page here. Or at the top of the front page.


Leave A Comment?