by matheist on 5/1/24, 9:12 PM with 0 comments
The interaural time and intensity differences are relatively straightforward to do — the sound source is here, the ears are there, introduce delay for speed of sound and attenuate by inverse of distance.
For the direction-dependent frequency attenuation and emphasis, I used a very small neural network to learn an HRTF (head-related transfer function) interpolating between head-related impulse responses at fixed directions.
Everything's running in the browser.