Boombox

The boombox is an 80s style tape and radio player that can be bought in the Shop at City South-West for $15,000. It currently never runs out of batteries.

## Usage

The top contains 3 dials (from left to right):

* Tape/radio selector
* On/Off switch
* Tuning knob

The right side has a knob to change the volume. The front has the controls for the tape deck and also has the digital display with station information. Behind the carry handle is an antenna that can be lifted up to get good radio reception. It can't be extended, just rotated.

The antenna and the knobs are operated using the mousewheel.

The boombox continues to play music when inside of the inventory. You get the best sound quality this way because the stereo effect is preserved when in your inventory.

### Placement

If you want to place the boombox somewhere in the game you can hold down the "R" key to place it somewhere instead of throwing it (using V). While holding "R", you can use the mousewheel to rotate the device. To place it, let go of "R"

## Audio Quality

The audio quality is as-is and is not changed to reflect radio signal loss or bad tape recordings.

## Soundtrack

The game comes with two radio stations included: Simulator Radio, and TruckersFM Additionally, various tapes can be bought at the different shops with music from Andrey Sitkov. These are designated with "A" and a number.

The shop that sells the boombox also sells tapes designated with "P" and a number from 1 to 10 inclusive. These are for custom tracks. See below for instructions.

## Radio

The radio is subject to signal loss and interference. When outside or in a train cab, it usually shows 100% signal. In buildings, the signal drops to around 70% and static noise can be heard. Inside of tunnels the signal usually drops to 0%. Signal loss is simply simulated by playing white noise while at the same time, lowering the stream volume. There is no simulation of losing the stereo signal itself first.

The boombox automatically switches to the next station in the list if the current stream is unavailable or sends invalid data. It will always play the next stream in the playlist regardless of the tuning direction you're using. This means that if the game figures out very quickly that a station is not working you may find yourself unable to tune backwards. In that case tune forwards until the list wraps around.

## Tape

Tapes are currently one-sided. The tape can be controlled using the buttons on the front. The seek buttons will not seek in the traditional sense but skips tracks like a CD player. Tapes do not repeat automatically, but the track list "wraps around" when you manually skip the last track. Once the tape stopped after the last track, you can just skip one further to land at the beginning again, then press play to start the tape.

The game remembers the playback position of your tape.

## Playlist editing

You can edit the radio stations and add your own playlists.

### Supported formats

The game supports ogg and mp3 format only. This applies to streams as well as local files. Streaming is supported from HTTP and HTTPS.

### Loading lag

The game loads audio tracks synchronously. This means that the game will freeze for a short amount of time when loading a new track. How long depends on the track. MP3 files with a lot of metadata and a cover art in front of the audio will likely freeze the game for 200 ms or longer. If this bothers you, consider making copies of the files you want to use in the game, then use a metadata editor to strip all information from the tracks.

### Automatic editing

The simplest way to edit your playlists is via 3rd party tools. The tool mentioned here is open source and can also be found on github. This tool keeps the playlist files in a valid state, and will convert unsupported music formats for you automatically.

### Manual editing

The playlists are contained inside the Derail Valley main folder under `DerailValley_Data\StreamingAssets\music`.

The game supports the M3U and PLS format. The playlist for the radio is named "Radio.pls" and the playlists for your own tapes are named "Playlist\_XX.pls", where XX ranges from 01-10.

You can open these files in a text editor. General Format:

```
[playlist]
File1=C:\Path\To\File.mp3
Length1=123
Title1=Title of Track
NumberOfEntries=1
Version=2

```

#### Description of fields

Description
 File`X` | Path to song
 Length`X` | Number
 Title`X` | Any string
 NumberOfEntries
 Version

The Counter (X) for the File/Length/Title field starts at 1 and increases for every track (File1, File2, ...).

Do not use quotes around file names, even if they contain spaces.

### Copyright

Be careful with the audio tracks and radio stations you chose. If you record/stream your gameplay you may run into problems when using copyrighted works that are not free to use. You will likely find your stream/video muted or taken down. Note that this also applies to the default radio station.