Audio Panning and ITD

I’ve got a problem implementing ITD, making a delay in one speaker compared to the other. The module for sound only cover basic properties of the sound like attenuation and direction of the sound. I however am trying to find out how blender takes the player position and angle towards the sound which it needs to calculate the velocities of the sound in the left and right speaker.

How can I get access to the basic sound handling for panning?