Looping sound datums

Used to play sound(s) on repeat until they are stopped Processed by the SSloopingsounds /datum/controller/subsystem/loopingsounds
Vars | |
ambient_sound | Is this considered an ambient sound for pref purposes |
---|---|
chance | (num) % Chance per loop to play a mid_sound |
direct | (bool) If true plays directly to provided atoms instead of from them |
end_sound | (soundfile) The sound played after the main loop has concluded |
end_volume | (num) Override for volume of end sound |
falloff | The rate the volume falls off. Higher = volume drops slower |
max_loops | (num) The max amount of loops to run for. |
mid_length | (num) The length to wait between playing mid_sounds |
mid_sounds | (list or soundfile) Since this can be either a list or a single soundfile you can have random sounds. May contain further lists but must contain a soundfile at the end. |
output_atoms | (list of atoms) The destination(s) for the sounds |
range | Range the sound will travel |
skip_starting_sounds | Do we skip the starting sounds? |
sound_channel | Sound channel to play on, random if not provided |
start_length | (num) How long to wait in ticks before starting the main loop after playing start_sound |
start_sound | (soundfile) Sound played before starting the mid_sounds loop |
start_time | (num) world.time when the datum started looping |
start_volume | (num) Override for volume of start sound |
timer_id | The ID of the timer that's used to loop the sounds. |
vary | (bool) Whether sounds played by this datum should be slightly varied by [/proc/playsound()] |
volume | (num) Sound output volume |
Procs | |
get_sound | Picks and returns soundfile Arguments: |
on_start | Called on loop start plays start sound, sets start_time then inserts into subsystem |
on_stop | Called on loop end if there is a end_sound, plays it |
play | Plays a sound file to our output_atoms Arguments: |
sound_loop | A simple proc handling the looping of the sound itself. |
start | Performs checks for looping and optinally adds a new atom to output_atoms, then calls [/datum/looping_sound/proc/on_start()] |
stop | Performs checks for ending looping and optinally removes an atom from output_atoms, then calls [/datum/looping_sound/proc/on_stop()] |
Var Details
ambient_sound

Is this considered an ambient sound for pref purposes
chance

(num) % Chance per loop to play a mid_sound
direct

(bool) If true plays directly to provided atoms instead of from them
end_sound

(soundfile) The sound played after the main loop has concluded
end_volume

(num) Override for volume of end sound
falloff

The rate the volume falls off. Higher = volume drops slower
max_loops

(num) The max amount of loops to run for.
mid_length

(num) The length to wait between playing mid_sounds
mid_sounds

(list or soundfile) Since this can be either a list or a single soundfile you can have random sounds. May contain further lists but must contain a soundfile at the end.
output_atoms

(list of atoms) The destination(s) for the sounds
range

Range the sound will travel
skip_starting_sounds

Do we skip the starting sounds?
sound_channel

Sound channel to play on, random if not provided
start_length

(num) How long to wait in ticks before starting the main loop after playing start_sound
start_sound

(soundfile) Sound played before starting the mid_sounds loop
start_time

(num) world.time when the datum started looping
start_volume

(num) Override for volume of start sound
timer_id

The ID of the timer that's used to loop the sounds.
vary

(bool) Whether sounds played by this datum should be slightly varied by [/proc/playsound()]
volume

(num) Sound output volume
Proc Details
get_sound
Picks and returns soundfile Arguments:
- starttime: world.time when this loop started
- _mid_sounds: sound selection override as compared to the usual mid_sounds
on_start
Called on loop start plays start sound, sets start_time then inserts into subsystem
on_stop
Called on loop end if there is a end_sound, plays it
play
Plays a sound file to our output_atoms Arguments:
- soundfile: sound file to be played
- volume_override: Optional argument to override the usual volume var for this sound
sound_loop
A simple proc handling the looping of the sound itself.
Arguments:
- start_time - The time at which the
mid_sounds
started being played (so we know when to stop looping).
start
Performs checks for looping and optinally adds a new atom to output_atoms, then calls [/datum/looping_sound/proc/on_start()]
stop
Performs checks for ending looping and optinally removes an atom from output_atoms, then calls [/datum/looping_sound/proc/on_stop()]