Types/Sound: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Added page.)
 
(added some more properties)
Line 1: Line 1:
==Basics==
==Basics==
This type is used to produce sound from in-game entities, ambient sound, and music.
This type is used to produce sound from in-game entities, ambient sound, and music.
==Properties==
== Mandatory properties ==
===filename===
===filename===
'''Type''': [[Types/FileName]]
'''Type''': [[Types/FileName]]


Used to let the game know what audio file you want it to use.
Used to let the game know what audio file you want it to use.
===sound===
'''Type''': ???
Can be used instead of "filename".
Example:
    "sound": {"filename": "__base__/sound/substation.ogg"},
===volume===
===volume===
'''Type''': [[Types/unsigned]]
'''Type''': [[Types/unsigned]]


Decides how loud the audio is.
Decides how loud the audio is.
=== apparent_volume ===
'''Type''': [[Types/double]]
Can be used instead of "volume".
== Optional properties ==
=== audible_distance_modifier ===
'''Type''': [[Types/double]]
Modifies how far a sound can be heard. Default is ? which means that the sound can be heard up to ? tiles away from the entity.
=== probability ===
'''Type''': [[Types/double]]
Modifies how often the sound is played.
==Example==
==Example==
     {
     {

Revision as of 19:17, 17 July 2017

Basics

This type is used to produce sound from in-game entities, ambient sound, and music.

Mandatory properties

filename

Type: Types/FileName

Used to let the game know what audio file you want it to use.

sound

Type: ???

Can be used instead of "filename".

Example:

   "sound": {"filename": "__base__/sound/substation.ogg"},

volume

Type: Types/unsigned

Decides how loud the audio is.

apparent_volume

Type: Types/double

Can be used instead of "volume".

Optional properties

audible_distance_modifier

Type: Types/double

Modifies how far a sound can be heard. Default is ? which means that the sound can be heard up to ? tiles away from the entity.

probability

Type: Types/double

Modifies how often the sound is played.


Example

   {
     filename = "__base__/sound/ambient/world-ambience-3.ogg",
     volume = 1.2
   }