Skip to main content

# Azuracast

Scrobbling Threshold

Azuracast may not correctly report track length or position. If this is the case you should reduce the "listened to" duration using Scrobble Thresholds so that multi-scrobbler scrobbles correctly.

The Azuracast server should have Use High-Performance Now Playing Updates enabled in Administration -> System Settings

### URL​

The URL used by MS to connect to Azuracast has the syntax:

    [ws|wss]://HOST:[PORT]

MS will automatically add the path required for websockets, `/api/live/nowplaying/websocket`, to your URL if none is provided. If you use a reverse proxy with a path-based URL or otherwise need a custom path to access the websockets path correctly then explicitly provide it. Examples:

    URL From Config                => MS Uses

    'ws://192.168.0.101'                 => ws://192.168.0.101/api/live/nowplaying/websocket
    'ws://azura.mydomain.com'            => ws://azura.mydomain.com.com/api/live/nowplaying/websocket
    'wss://mydomain.com/custom/azura/ws' => wss://mydomain.com/custom/azura/ws

Auto Monitoring Behavior

This Source supports toggling monitoring on or off manually. This action can be taken on the Web Dashboard by clicking the link next to Monitoring found in each Source's status card.

Additionally, the default monitoring behavior can be explicitly set by adding the following value to a Source's `options` in file or aio config:

azuracast.json

    {
      "data": {
          // ...
      },
      "options": {
          // set to true to always monitor (unless manually invoked)
          // set to false to never monitor (unless manually invoked)
          "autoMonitor": true
      }
    }}

When `autoMonitor` is not explicitly set, Multi-scrobbler will set the default monitoring behavior based on if either of these settings is configured:

- live status (`AZURA_LIVE` or `monitorWhenLive`) or
- listener count (`AZURA_LISTENERS_NUM` or `monitorWhenListeners`)

If either is configured then MS will automatically monitor based on when these conditions are met.

If neither is configured automatic monitoring defaults to off and you should either manually initiate it or explicitly set the default behavior.

### Station​

#### Station Identifier​

The station identifier multi-scrobbler uses (ENV `AZURA_STATION` or `station` in File/AIO config) needs to be the URL Stub or shortcode of the Azuracast station, not its display name. Use of the methods below to find an apprioriate station identifier.

- URL Stub
- Shortcode

The URL Stub is the value used in the URL to access the station EX

    https://azura.mydomain.com/public/my-cool-station
                                      ^^^^ url stub ^^

Use `my-cool-station` as the station identifier.

The shortcode can be found in the raw JSON response for your station. Navigate to this URL in your browser:

    https://azura.mydomain.com/api/stations

Find your station in the returned data (by `name`) and then locate the value of the `shortcode` property in that object.

Example

    [
        {
            "id": 1,
            "name": "My Cool Station",
            "shortcode": "my-cool-station",
            "description": "Re-broadcasts of my cool music",
            "frontend": "icecast",
            "backend": "liquidsoap",
            ...

Use `my-cool-station` as the station identifier.

#### Station Access​

Multi-Scrobbler does not use authentication to communicate with Azuracast. Your station will likely need some form of Public Pages in order for you to monitor it.

In your station's Edit Station Settings -> Public Pages make sure that at least one of these is enabled:

- Enable Public Pages
- Enable Public APIs

note

For users who aren't administrators of Azuracast: if you can access the station using `https://azura.mydomain.com/public/xxxxxx` then it is public.

## Configuration​

- ENV
- File
- AIO

Configuration Type

This is configuration for the ENV Config Type.

Environmental Variable | Type | Default | Description
--- | --- | --- | ---
`AZURA_ID` | string |  | A globally unique ID EX `myComponentId`
`AZURA_NAME` | string | Value of `AZURA_ID` | A vanity name EX `My Cool Component`
`AZURA_ENABLE` | boolean | true | Should this component be used?
`AZURA_STATION` | string |  | The specific station to monitor
`AZURA_URL` | string |  | Base URL of the Azuracast instance
`AZURA_KEY` | string |  | API Key used to access data about private streams
`AZURA_LISTENERS_NUM` | string |  |
`AZURA_LIVE` | boolean |  |

Bold/Italic = Required

Config Structure

This displays the structure of the File Configuration for a azuracast type Source with all possible properties, their shape, and descriptions/types. Use this to understand how to write a valid config.

Loading ...
Config Example

This displays an example config file of a azuracast Source File Configuration that adheres to the shown Config Structure.

- text mode lets you edit the JSON directly.
- tree mode gives you a guided point-and-click editing experience that always keeps the JSON syntax valid.

Both modes validate that the configuration is correct. Any errors show up as squiggly lines.

important

Only source azuracast configs will validate correctly in the editor but both source and client azuracast configs are allowed in the real `CONFIG/azuracast.json`

After you finish editing, switch to text and then copy all text to get a completed config.

Config Example Mobile Experience

This displays an example config file of a azuracast Source File Configuration that adheres to the shown Config Structure.

The example config file editor is meant for a larger screen experience so only the read-only example is shown. Please use this site on a tablet/laptop/desktop to enable file editor features.

CONFIG/azuracast.json

    [
      {
        "type": "azuracast",
        "enable": true,
        "name": "Cool Station",
        "id": "myAzura",
        "data": {
          "url": "ws://192.168.0.101",
          "station": "my-station-name",
          "monitorWhenLive": true,
          "monitorWhenListeners": 1
        }
      }
    ]

Config Structure

This displays the structure of the all-in-one (`config.json`) configuration with all possible properties, their shape, and descriptions/types. Use this to understand how to write a valid config.

Select the azuracast type from the respective `sources` node below, then expand it.

Loading ...
Config Example

This displays an example config file of a all-in-one (`config.json`) configuration that includes a azuracast Source that adheres to the shown Config Structure.

- text mode lets you edit the JSON directly.
- tree mode gives you a guided point-and-click editing experience that always keeps the JSON syntax valid.

Both modes validate that the configuraion is correct. Any errors show up as squiggly lines.

After you finish editing, switch to text and then copy all text to get a completed config.

Config Example Mobile Experience

This displays an example config file of a all-in-one (`config.json`) configuration that includes a azuracast Source that adheres to the shown Config Structure.

The example config file editor is meant for a larger screen experience so only the read-only example is shown. Please use this site on a tablet/laptop/desktop to enable file editor features.

CONFIG/config.json

    {
      "sources": [
        {
          "type": "azuracast",
          "enable": true,
          "name": "Cool Station",
          "id": "myAzura",
          "data": {
            "url": "ws://192.168.0.101",
            "station": "my-station-name",
            "monitorWhenLive": true,
            "monitorWhenListeners": 1
          }
        }
      ]
    }