Swift: How to make positional audio more realistic for sound localization?

I am coding some application about sound localization and I used.isPositional in SCNAudioPlayerto produce spatial audio on a SCNNode. Here is what my codes like:

func spatialAudio(inputNode: SCNNode){
    let audio = SCNAudioSource(fileNamed: "source.wav")
    audio!.isPositional = true
    audio?.load()
    let player = SCNAudioPlayer(source: audio!)
    inputNode.addAudioPlayer(player)
}

But the outcome of the spatial audio isn't quite well that it is difficult for user to localize the sound source. Is there any other way to produce more realistic spatial audio in Swift?

I have heard of some algorithms used in sound localization, like head-related transfer function (HRTF), interaural time difference (ITD), and interaural level difference (ILD). Does Swift's positional audio use these algorithms? If it doesn't, how could I alter the audio to use these algorithms?