pub struct Sound {Show 13 fields
pub name: &'static str,
pub allow_random_repeat: Option<bool>,
pub audible_distance_modifier: Option<f64>,
pub filename: Option<&'static str>,
pub max_speed: Option<f64>,
pub max_volume: Option<f64>,
pub min_speed: Option<f64>,
pub min_volume: Option<f64>,
pub preload: Option<bool>,
pub priority: Option<i64>,
pub speed: Option<f64>,
pub speed_smoothing_window_size: Option<i64>,
pub volume: Option<f64>,
}Expand description
Minimal SoundPrototype for data.extend.
Specifies a sound that can be used with SoundPath at runtime.
type = "sound" is injected by the Lua generator.
Fields§
§name: &'static strName of the sound. Can be used as a SoundPath at runtime.
allow_random_repeat: Option<bool>Prototype property allow_random_repeat.
audible_distance_modifier: Option<f64>Modifies how far a sound can be heard. Must be between 0 and 1 inclusive.
filename: Option<&'static str>Supported sound file formats are .ogg (Vorbis and Opus) and .wav.
Only loaded, and mandatory if variations is not defined.
max_speed: Option<f64>Must be >= min_speed.
Only loaded if variations is not defined. Only loaded, and mandatory if min_speed is defined.
max_volume: Option<f64>Only loaded if variations is not defined.
Only loaded if min_volume is defined.
Must be >= min_volume.
min_speed: Option<f64>Must be >= 1 / 64.
Only loaded if both variations and speed are not defined.
min_volume: Option<f64>Only loaded if variations and volume are not defined.
Must be >= 0.
preload: Option<bool>Only loaded if variations is not defined.
priority: Option<i64>Sounds with higher priority will replace a sound with lower priority if the maximum sounds limit is reached.
0 is the highest priority, 255 is the lowest priority.
speed: Option<f64>Speed must be >= 1 / 64. This sets both min and max speeds.
Only loaded if variations is not defined.
speed_smoothing_window_size: Option<i64>Prototype property speed_smoothing_window_size.
volume: Option<f64>Only loaded if variations is not defined.
This sets both min and max volumes.
Must be >= 0.