■ Contenu
■ 1. Présentation
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. Syntaxe
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:
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:
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:
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]
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.
Position: Center
Radius: 10.0m
● [Flange]
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.
Position: Center
Radius: 10.0m
● [Motor]
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.
Position: Center
Radius: 10.0m
● [Switch]
Assigns a switch sound- These are played once per axle when the train crosses a block containing pointwork. The non-negative integer Index represents the type of switch 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.
Position: FrontAxle / RearAxle
Radius: 5.0m
● [Brake]
Played occasionally when the pressure in the brake cylinder is decreased from a high value.
Position: Center
Radius: 5.0m
Played occasionally when the pressure in the brake cylinder is decreased from a non-high value to a non-zero value.
Position: Center
Radius: 5.0m
Played occasionally when the pressure in the brake cylinder is decreased to zero value.
Position: Center
Radius: 5.0m
Played once when the emergency brakes are activated.
Position: Center
Radius: 10.0m
Played once when the emergency brakes are released.
Position: Center
Radius: 10.0m
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.
Position: Center
Radius: 5.0m
● [Compressor]
Played once when the air compressor is activated.
Played in a loop for the duration the air compressor is active.
Played once when the air compressor is deactivated.
Position: Center
Radius: 10.0m
● [Suspension]
Played occasionally when the train sways to the left side.
Played occasionally when the train sways to the right side.
Position: Left / Right
Radius: 5.0m
● [Horn]
There are two possible types of horn which may be defined via a [Horn] section- ‘Looped Horns’ and ‘Legacy Horns’
Looped Horns
A looped horn is made up of three components:
A start sound, a loop sound and an end sound.
The start sound is played once, followed by the loop sound for the duration of the keypress. When the horn key is released, the end sound will be played once.
SecondaryStart = FileName
MusicStart = FileName
Played once when the given horn is applied.
SecondaryLoop = FileName
MusicLoop = FileName
Played in a loop whilst the given horn is active.
SecondaryEnd = FileName
MusicEnd = FileName
Played once when the given horn is released.
Legacy Horns
A legacy horn is made up of a single sound.
Played once whilst the primary horn is active.
Played once whilst the secondary horn is active.
Played in a continuous loop whilst the music horn is active.
Position: Front
Radius: 10.0m for Music Horns, 30.0m for all other Horns
● [Door]
Played once when the left doors open.
Played once when the right doors open.
Played once when the left doors close.
Played once when the right doors close.
Position: Left / Right
Radius: 5.0m
The duration of these sound files is used to determine the opening and closing speed of the doors.
If both a Left and a Right sound is present, then both sets of doors will open / close in the average duration of the two sounds.
If a single sound is present, then both sets of doors will open / close in the duration of this sound.
● [Ats]
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.
Position: Panel
Radius: 2.0m
● [Buzzer]
Played once when the train stops at a station, but needs to correct its stop position.
Position: Panel
Radius: 2.0m
● [Pilot Lamp]
Played once as soon as the doors have closed and the train is ready for departure.
Played once as soon as the doors start to open.
Position: Panel
Radius: 2.0m
● [Brake Handle]
Played once when the brake notch is increased to any value below the emergency brake position.
Played once for each notch when the brake notch is increased in a continuous motion to any value below the emergency brake position.
Played once when the brake notch is increased in a continuous motion to any value below the emergency brake position.
Played once for each notch when the brake notch is decreased in a continuous motion to any value above brake notch zero.
Played once when the brake notch is decreased to brake notch zero.
Played once when the emergency brakes are applied.
Position: Panel
Radius: 2.0m
If the ApplyFast sound is not present, then the Apply sound will be played instead. Similarly, if ReleaseFast is not present, then Release will be played instead.
● [Master Controller]
Played once when the power notch is increased to any value below the maximum power notch.
Played once for each notch when the power notch is increased in a single continuous motion to any value below the maximum power notch.
Played once when the power notch is decreased to any value above power notch 0.
Played once for each notch when the power notch is decreased in a single continuous motion to any value above power notch 0.
Played once when the power notch is decreased to brake notch zero.
Played once when the power notch is increased to the maximum power notch.
Position: Panel
Radius: 2.0m
If the UpFast sound is not present, then the Up sound will be played instead. Similarly, if DownFast is not present, then Down will be played instead.
● [Reverser]
Played once when the reverser is moved into any non-neutral position.
Played once when the reverser is moved into the neutral position.
Position: Panel
Radius: 2.0m
● [Breaker]
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.
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.
Position: Panel
Radius: 5.0m
● [Windscreen]
Played when a rain drop hits the windscreen.
Played when the wiper moves with more than 20% of the available drops visible.
Played when the wiper moves with less than 20% of the available drops visible.
Played when the wiper switch is moved.
Position: Panel
Radius: 2.0m
● [Others]
Played in a loop all the time for the duration of the simulation.
Position: Center
Radius: 10.0m
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.
Position: Center
Radius: 10.0m
Played once or in a loop (depending on the train.dat setting) when the pass alarm system warns about an approaching station stop.
Position: Panel
Radius: 2.0m