Factorio.com|Forums|Wiki|Mod Portal|API Docs Prototype|Runtime|Auxiliary

# Factorio Prototype Docs Version 2.0.7

## WorkingSound :: struct or Sound Example code

This type is used to produce sound from in-game entities when they are working/idle.

Inherits from MainSound

## Properties

- default
- sorted

main_sounds optional | :: MainSound or array[MainSound] | If this property is defined, all properties inherited from MainSound (and not overridden here) are ignored.
If this property is defined, all properties inherited from MainSound (and not overridden here) are ignored.
apparent_volume optional | :: float |
max_sounds_per_type optional | :: uint8 |
extra_sounds_ignore_limit optional | :: bool |
persistent optional | :: bool |
use_doppler_shift optional | :: bool |
idle_sound optional | :: Sound | The sound to be played when the entity is idle. [...]
The sound to be played when the entity is idle. [...]
activate_sound optional | :: Sound | Might not work with all entities that use working_sound.
Might not work with all entities that use working_sound.
deactivate_sound optional | :: Sound | Might not work with all entities that use working_sound.
Might not work with all entities that use working_sound.
sound_accents optional | :: SoundAccent or array[SoundAccent] |

Inherited from MainSound

sound optional | :: Sound |
audible_distance_modifier[overridden] optional | :: double | Modifies how far a sound can be heard. [...]
Modifies how far a sound can be heard. [...]
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 | :: bool |
match_volume_to_activity optional | :: bool |
match_speed_to_activity optional | :: bool |
play_for_working_visualisations optional | :: array[string] |

activate_sound optional | :: Sound | Might not work with all entities that use working_sound.
Might not work with all entities that use working_sound.
apparent_volume optional | :: float |
deactivate_sound optional | :: Sound | Might not work with all entities that use working_sound.
Might not work with all entities that use working_sound.
extra_sounds_ignore_limit optional | :: bool |
idle_sound optional | :: Sound | The sound to be played when the entity is idle. [...]
The sound to be played when the entity is idle. [...]
main_sounds optional | :: MainSound or array[MainSound] | If this property is defined, all properties inherited from MainSound (and not overridden here) are ignored.
If this property is defined, all properties inherited from MainSound (and not overridden here) are ignored.
max_sounds_per_type optional | :: uint8 |
persistent optional | :: bool |
sound_accents optional | :: SoundAccent or array[SoundAccent] |
use_doppler_shift optional | :: bool |

Inherited from MainSound

activity_to_speed_modifiers optional | :: ActivityMatchingModifiers |
activity_to_volume_modifiers optional | :: ActivityMatchingModifiers |
audible_distance_modifier[overridden] optional | :: double | Modifies how far a sound can be heard. [...]
Modifies how far a sound can be heard. [...]
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 | :: bool |
match_speed_to_activity optional | :: bool |
match_volume_to_activity optional | :: bool |
play_for_working_visualisations optional | :: array[string] |
probability optional | :: double | Modifies how often the sound is played.
Modifies how often the sound is played.
sound optional | :: Sound |

## Properties

### main_sounds :: MainSound or array[MainSound] optional

If this property is defined, all properties inherited from MainSound (and not overridden here) are ignored.

### apparent_volume :: float optional

Default: `1`

### max_sounds_per_type :: uint8 optional

### extra_sounds_ignore_limit :: bool optional

Default: `false`

### persistent :: bool optional

Default: `false`

### use_doppler_shift :: bool optional

Default: `true`

### idle_sound :: Sound optional

The sound to be played when the entity is idle. Might not work with all entities that use working_sound.

### activate_sound :: Sound optional

Might not work with all entities that use working_sound.

### deactivate_sound :: Sound optional

Might not work with all entities that use working_sound.

### sound_accents :: SoundAccent or array[SoundAccent] optional

## Overridden Properties

### audible_distance_modifier :: double optional

Default: `1`

Modifies how far a sound can be heard. Can only be 1 or lower, has to be a positive number.

## Examples

    -- refinery
    working_sound =
    {
      sound = { filename = "__base__/sound/oil-refinery.ogg" },
      idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 },
      apparent_volume = 2.5,
    }

    -- roboport
    working_sound =
    {
      sound = { filename = "__base__/sound/roboport-working.ogg", volume = 0.6 },
      max_sounds_per_type = 3,
      audible_distance_modifier = 0.5,
      probability = 1 / (5 * 60) -- average pause between the sound is 5 seconds
    }

Type used in

- EntityPrototype::working_sound