Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Prototype Docs Version 2.0.77

# MainSound - Prototype Docs

## MainSound :: struct

Children WorkingSound

## Properties

- default
- sorted

sound optional | :: Sound | Cannot be empty.
Cannot be empty.
probability optional | :: double | Modifies how often the sound is played. [...]
Modifies how often the sound is played. [...]
fade_in_ticks optional | :: uint32 | Can't be used when `match_progress_to_activity` is `true`.
Can't be used when `match_progress_to_activity` is `true`.
fade_out_ticks optional | :: uint32 | Can't be used when `match_progress_to_activity` is `true`.
Can't be used when `match_progress_to_activity` is `true`.
activity_to_volume_modifiers optional | :: ActivityMatchingModifiers |
activity_to_speed_modifiers optional | :: ActivityMatchingModifiers |
match_progress_to_activity optional | :: boolean | Unused when WorkingSound::persistent is `true`.
Unused when WorkingSound::persistent is `true`.
match_volume_to_activity optional | :: boolean |
match_speed_to_activity optional | :: boolean |
play_for_working_visualisations optional | :: array[string] | Array of WorkingVisualisation::names, individual names cannot be empty. [...]
Array of WorkingVisualisation::names, individual names cannot be empty. [...]
volume_smoothing_window_size optional | :: uint32 | Only used if WorkingSound::persistent is `true`.
Only used if WorkingSound::persistent is `true`.

activity_to_speed_modifiers optional | :: ActivityMatchingModifiers |
activity_to_volume_modifiers optional | :: ActivityMatchingModifiers |
fade_in_ticks optional | :: uint32 | Can't be used when `match_progress_to_activity` is `true`.
Can't be used when `match_progress_to_activity` is `true`.
fade_out_ticks optional | :: uint32 | Can't be used when `match_progress_to_activity` is `true`.
Can't be used when `match_progress_to_activity` is `true`.
match_progress_to_activity optional | :: boolean | Unused when WorkingSound::persistent is `true`.
Unused when WorkingSound::persistent is `true`.
match_speed_to_activity optional | :: boolean |
match_volume_to_activity optional | :: boolean |
play_for_working_visualisations optional | :: array[string] | Array of WorkingVisualisation::names, individual names cannot be empty. [...]
Array of WorkingVisualisation::names, individual names cannot be empty. [...]
probability optional | :: double | Modifies how often the sound is played. [...]
Modifies how often the sound is played. [...]
sound optional | :: Sound | Cannot be empty.
Cannot be empty.
volume_smoothing_window_size optional | :: uint32 | Only used if WorkingSound::persistent is `true`.
Only used if WorkingSound::persistent is `true`.

## Properties

### sound :: Sound optional

Cannot be empty.

### probability :: double optional

Default: `1`

Modifies how often the sound is played.

Silently clamped to the [0.0, 1.0] range.

Unused when WorkingSound::persistent is `true`.

#### Example

    probability = 1 / (3 * 60) -- average pause between the sound is 3 seconds

### fade_in_ticks :: uint32 optional

Default: `0`

Can't be used when `match_progress_to_activity` is `true`.

### fade_out_ticks :: uint32 optional

Default: `0`

Can't be used when `match_progress_to_activity` is `true`.

### activity_to_volume_modifiers :: ActivityMatchingModifiers optional

### activity_to_speed_modifiers :: ActivityMatchingModifiers optional

### match_progress_to_activity :: boolean optional

Default: `false`

Unused when WorkingSound::persistent is `true`.

### match_volume_to_activity :: boolean optional

Default: `false`

### match_speed_to_activity :: boolean optional

Default: `false`

### play_for_working_visualisations :: array[string] optional

Array of WorkingVisualisation::names, individual names cannot be empty.

The `sound` is played when at least one of the specified working visualisations is drawn.

Unused when WorkingSound::persistent is `true`.

### volume_smoothing_window_size :: uint32 optional

Default: `0`

Only used if WorkingSound::persistent is `true`.

Type used in

- RollingStockPrototype::elevated_rail_sound
- WorkingSound::main_sounds