Configuring Your SM2 Station - ymatto/Station-Manager-2 GitHub Wiki
Station Manager is designed to let you act as the owner of a netradio station that runs like a traditional AM/FM broadcast station. You define the shows that will run on your station, the playlist of music those shows will play, "who" will DJ those shows, and the schedule of shows 24/7.
You will create your own netradio station by creating its own folder to hold your folders of music playlists. You may want to copy the example/
folder as a template. You'll see that this folder contains 3 JSON configuration filesthat SM2 expects to find:
stationconfig.json
- The station config defines global parameters for the station and its icecast broadcast.showconfig.json
- The show config defines parameters for each show your station will play.showschedule.json
- The show schedule defines the schedule on which the various shows will play.
Different filenames can be used for all three files, letting you do things like configure multiple netradio stations in the same folder and run them with different instances of Station Manager. The filenames above are the defaults Station Manager will look for, but a different station config file can be specified as an argument to Station Manager, and that config file can in turn specify paths for show config and show schedule.
The included example config files set up a netradio station from the included pair of folders of music in the music/
folder, and are a good place to start in customizing your own netradion station.
Here is a breakdown of the available parameters in the json config files.
Station Config
The station config is a JSON dictionary with the following possible keys. Keys with default values may be omitted, but keys that are REQUIRED must be specified in the file to successfully create a station.
Key | Type | Default | Description |
---|---|---|---|
showconfig_path | String | showconfig.json |
Path to the show config file to use |
showschedule_path | String | showschedule.json |
Path to the show schedule file to use |
playlists_root | String | music/ |
Path to folder containing playlist folders to be identified by name for shows |
icecast_name | String | (empty) | Name used in Icecast metadata |
icecast_description | String | A Station Manager 2 netradio station |
Description used in Icecast metadata |
icecast_genre | String | (empty) | Genre used in Icecast metadata |
icecast_url | String | (empty) | Station URL used in Icecast metadata. This may not end in the icecast_mount defined below if Icecast has been configured with an alias to the mount |
icecast_mount | String | radio.mp3 |
Where the broadcast stream will be mounted at the Icecast host |
icecast_encoding | String | mp3_128k |
Audio format to use for Icecast broadcast to users. Must be one of: mp3_320k , mp3_256k , mp3_192k , mp3_160k , mp3_128k , mp3_64k , vorbis_q3 (quality 3), vorbis_q6 (quality 6) |
icecast_password | String | REQUIRED | Password Icecast requires for input audio |
icecast_host | String | localhost |
Where station manager can find the Icecast host. If running dockerized, this will often be the mount name applied to the Icecast container |
icecast_port | Number | 8000 | Port where Icecast communicates |
id_announcement | String | (empty) | Text, or path to audio file within the station's announcements_path , used for hourly station IDs |
voice_type | String | (empty) | The TTS handler used for announcements. If the voice_type is unsupported, announcements must be paths to prerecorded audio files rather than text to speak. Currently only tts_server_macos is supported, using the TTS_server script (see below) |
default_voice | String | (empty) | Voice to specify to TTS handler, if the show has not specified one |
tts_server_endpoint | String | http:// host.docker.internal:3000 /say |
URL where you have configured the TTS_server script to listen, if a TTS handler has been specified for the voice_type |
log_path | String | logs/StationManager2.log |
Path to general running log from Liquidsoap. If set to empty, no log is written |
tracklog_path | String | logs/recent_tracks.log |
Path to a list of the most recently played tracks. If set to empty, no log is written |
currentshow_path | String | logs/current_show.log |
Path to a file listing the currently-playing show. If set ot empty, no long is written |
telnet_server | Boolean | false |
If set to true , enables a telnet server to send manual commands to the station |
telnet_server_port | Number | 1234 | Port where the server listens |
telnet_server_timeout | Number | 60 | Seconds that an inactive telnet connection remains alive. Set to a negative number to keep it open indefinitely |
telnet_server_netmask | String | "0.0.0.0" | Netmask for allowed telnet server connections |
announcements_path | String | announcements/ |
Path to folder containing pre-recorded announcement audio files that may be referenced by filename |
tts_announcements_path | String | /tmp/ |
Path to folder where the TTS_server script is configured to write out audio files for use |
Show Config
The show config is a JSON dictionary containing a list of dictionary keys for each show.
Create a dictionary for each show and name it with the key you will use to refer to each show in the show schedule (for example Hiphop
).
Each show dictionary in turn is defined by this list of keys. Keys with default values may be omitted, but keys that are REQUIRED must be specified in the file to successfully create a show.
Key | Type | Default | Description |
---|---|---|---|
playlist_path | String | REQUIRED | Path to this show's folder of music within the playlist_root in the station config |
show_longname | String | (empty) | Currently only used when writing out a log to the currentshow_path |
show_description | String | (empty) | Currently not used |
DJ_voice | String | (empty) | TTS voice to use for announcements during this show. If empty, the station's default_voice will be used |
signon_announcement | String | (empty) | Voiceover text to speak when the show begins, or path to audio within the station's announcements_path |
signoff_announcement | String | (empty) | Voiceover text to speak just before the show ends, or path to audio within the station's announcements_path |
shuffle_mode | String | songs |
Method of shuffling songs within the playlist folder (currently only songs is supported) |
Show Schedule
The show schedule is a JSON array of show schedule entries. Each entry is a definition of a 24-hour day of programming, and can specify how that day is filled with shows, and when this particular profile of programming day is used (for example "on Mondays, Wednesdays, and Fridays").
Each show schedule entry is itself a dictionary with the following keys:
Key | Type | Default | Description |
---|---|---|---|
type | String | everyday |
Type of schedule this schedule entry. Currentl options are everyday (days key not used) and daysofweek (days key required) |
days | Arra of Strings | REQUIRED (for daysofweek ) |
For type of daysofweek , the days of the week on which this show schedule entry applies, eg. ["Monday", "Wednesday", "Friday"] |
show_hours | Array of Numbers | REQUIRED | The hours of the day at which shows should change, eg. [6, 12, 20] would indicate that there should be a show change at 6am, noon, and 8pm. If 0 isn't specified, whatever show was playing at the end of the previous day will continue playing until the first indicated time. |
show_names | Array of Strings | REQUIRED | The names of the shows (by their key name in the show config) that should start at the times indicated in show_hours . This array must be of the same length as show_hours , with each time corresponding to each show name here. |
Conclusion
This should give you the flexibility you need to define your own netradio stations.
The only thing left is making sure that your Icecast configuration is correct for your preferences.