Sound.cfg

From BVEStation Wiki
Jump to: navigation, search

The sound.cfg file format



■ 1. Overview


The sound.cfg file allows to reference which sound files should be used, how they are called and where they are located relative to the train folder.

The sound.cfg file is a plain text file encoded in any arbitrary encoding, however, UTF-8 with a byte order mark is the preferred choice. The parsing model for numbers is Strict. The file is required to be located inside the train folder and is expected to be named sound.cfg. The file is interpreted on a per-line basis, from top to bottom.

See also the quick reference for the sound.cfg...


■ 2. Syntax



Each line in the file can be empty (or solely consist of white spaces) and will be ignored, can mark the beginning of a new section or contain key-value pairs inside a section. All key-value pairs relate to the last section opened.

A new section is opened by starting the line with an opening bracket (U+005B) and ending it with a closing bracket (U+005D). The text in-between the brackets indicates the name of the section and is case-insensitive. White spaces at the beginning and the end of the line are ignored, as well as at the beginning and the end of the name of the section. Thus, the beginning of the section has the following form:

[NameOfTheSection]


A key-value pair is indicated by giving the key, an equals sign (U+003D) and then the value. The key is case-insensitive. White spaces at the beginning and the end of the line are ignored, as well as in front and after the equals sign. Alternatively, white spaces surrounding the key and the value are ignored. Thus, a key-value pair as the following form:

NameOfTheKey = Value


You can use comments anywhere at the end of a line. A comment is started by a semicolon (U+003B). Comments, if present, are stripped away from all lines before these are processed.


■ 3. Content of the file


The first line in the file is required to be the following:

Version 1.0


Following the version line, these are the sections that can be used and their key-value pairs. In all key-value pairs, the parameter FileName corresponds to the file name of the sound to reference, relative to the train folder.


● [Run]


Index = FileName

Assigns a run sound. The non-negative integer Index represents the type of run sound to use. Route developers can choose which run sound to play for a given piece of track. Please see the page about standards for further information.

The sound is played at a pitch proportional to the speed. The recording should correspond to a speed of 90 km/h.


● [Flange]


Index = FileName

Assigns a flange sound. The non-negative integer Index represents the type of flange sound to use. Route developers can choose which flange sound to play for a given piece of track. Please see the page about standards for further information.

The sound is played at a pitch proportional to the speed. The recording should correspond to a speed of 45 km/h.


● [Motor]


Index = FileName

Assigns a motor sound. The non-negative integer Index represents the index of the motor sound that can be referenced in the #MOTOR_Xn sections of the train.dat. Please see the documentation for the train.dat for more information.


● [Switch]


0 = FileName

Played once per axle when the train crosses a pointwork.


● [Brake]


BC Release High = FileName

Played occasionally when the pressure in the brake cylinder is decreased from a high value.

BC Release = FileName

Played occasionally when the pressure in the brake cylinder is decreased from a non-high value to a non-zero value.

BC Release Full = FileName

Played occasionally when the pressure in the brake cylinder is decreased to zero value.

Emergency = FileName

Played once when the emergency brakes are activated.

BP Decomp = FileName

For trains with automatic air brake, is played when the handle is moved into the SRV or EMG position. For other trains, is played when the brake notch is decreased.


● [Compressor]


Attack = FileName

Played once when the air compressor is activated.

Loop = FileName

Played in a loop for the duration the air compressor is active.

Release = FileName

Played once when the air compressor is deactivated.


● [Suspension]


Left = FileName

Played occasionally when the train sways to the left side.

Right = FileName

Played occasionally when the train sways to the right side.


● [Horn]


Primary = FileName

Played once when the primary horn is applied.

Secondary = FileName

Played once when the secondary horn is applied.

Music = FileName

Played in a loop when the music horn is applied.


● [Door]


Open Left = FileName

Played once when the left doors open.

Open Right = FileName

Played once when the right doors open.

Close Left = FileName

Played once when the left doors close.

Close Right = FileName

Played once when the right doors close.


● [Ats]


Index = FileName

Assigns a plugin sound. The non-negative integer Index represents the sound index. Train plugin developers can choose which sound to play. The assignment of sounds needs to be coordinated with the plugin developer.


● [Buzzer]


Correct = FileName

Played once when the train stops at a station, but needs to correct its stop position.


● [Pilot Lamp]


On = FileName

Played once as soon as the doors have closed and the train is ready for departure.

Off = FileName

Played once as soon as the doors start to open.


● [Brake Handle]


Apply = FileName

Played once when the brake notch is increased to any value below the emergency brake position.

Release = FileName

Played once when the brake notch is decreased to any value above brake notch zero.

Min = FileName

Played once when the brake notch is decreased to brake notch zero.

Max = FileName

Played once when the emergency brakes are applied.


● [Master Controller]


Up = FileName

Played once when the power notch is increased to any value below the maximum power notch.

Down = FileName

Played once when the power notch is decreased to any value above power notch 0.

Min = FileName

Played once when the power notch is decreased to brake notch zero.

Max = FileName

Played once when the power notch is increased to the maximum power notch.


● [Reverser]


On = FileName

Played once when the reverser is moved into any non-neutral position.

Off = FileName

Played once when the reverser is moved into the neutral position.


● [Breaker]


On = FileName

Played once when power is resumed (was interrupted before). There is a series of circumstances when that can happen, for example when moving from power notch zero to power notch one, assuming the reverser is non-neutral and the brakes are released. It can also happen when the power notch is already non-zero, but the reverser or brakes previously interrupted the power. The safety systems can also interrupt power.

Off = FileName

Played once when power is interrupted or resumed. There is a series of circumstances when that can happen, for example when moving from power notch zero to power notch one, or vice versa, assuming the reverser is non-neutral and the brakes are released. The safety systems can also interrupt power.


● [Others]


Noise = FileName

Played in a loop all the time for the duration of the simulation.

Shoe = FileName

Played in a loop when the brake shoe rubs against the wheels. The sound is played at a pitch inversely proportional to the speed, and the volume of the sound decreases with increasing speeds.