extends AudioStreamPlayer3D
# Plays sounds at a random interval

@export var interval_mean := 60.0
@export var interval_st_dev := 10.0

@onready var timer: Timer = %Timer


func _ready() -> void:
	restart_timer()


func restart_timer() -> void:
	timer.start(maxf(0.0, randfn(interval_mean, interval_st_dev)))


func _on_timer_timeout() -> void:
	play()
	restart_timer()
