You should provide more code to better understand what is happening in your game, but you can fix your function:
func playAudioSource(from node: SCNNode, source audioSource: SCNAudioSource) { if let _ = node.parent, node.action(forKey: "playAudio") == nil { node.runAction(SCNAction.playAudio(audioSource, waitForCompletion: false),forKey:"playAudio") } }
This prevents the action from starting when the action is running or executing, and also checks if your node is already attached to its parent (this may be useful, it depends on where you run this code ..)
source share