Use Spatial Blend to mix between 2D and 3D audio.

0 = fully 2D
1 = fully 3D

Code:

audioSource.spatialBlend = 1f;

Distance controls:

audioSource.minDistance
audioSource.maxDistance

Use 2D for UI/music and 3D for world sounds.