AudioStreamPlayer discontinue the set_loop function
You will need to get the AudioStream of this object instead and call the function set_loop(x) where x the mode of the loop (https://docs.godotengine.org/en/stable/classes/class_audiostreamwav.html#class-audiostreamwav in the loop_mode section)