Binaries and source
HRIR database (you need both, the binary and one of these databases depending on your sampling frequency. The database must be, in principle, located in the same directory where the binary is)
We present an application capable of control the azimuth, elevation, and distance of sound objects in real-time. This 3D spatialization is done by computing the interpolation of a maximum of four HRIRs, depending on the virtual location, in real-time.
- Spatial audio cues are important in virtual environments to increase realism.
- Convolving sound sources with a binaural head-related impulse response (HRIR) is a popular technique to spatialize them.
- HRIR measurements are usually captured at a fixed distance, limiting the locations to points on a spherical surface.
- HRIR datasets including recordings at different distances have become available.
We used the database published in , 6344 locations recorded at 65.536 kHz (1024 taps):
- Diffuse field equalization for headphone reproduction
- Regularize grid: spacing 5º in azimuth, 10º in elevation, and 10 cm in distance.
- Missing locations were linearly interpolated (LERP)
- Only the right hemisphere HRIRs were stored in a SQLite database for the real-time application.
- Create a Pure-data object named hrir˜.
- Up to four HRIRs are selected for interpolation.
- Convolution is computed for every DSP block in Pd (64 samples by default).
- Constant-power cross-fading with the output of the previous block
- Fresh interpolations are performed only if the location of the virtual source is changed.
- Users can specify the number of taps to be used in the interpolation as an argument of the hrir~ object. This number of taps must be a power of two.
- Left outlet outputs the convolved signal for the left ear
- Right outlet outputs the convolved signal for the right ear
- Adjustable number of taps via HRIR˜ argument
Linear interpolations used in HRIR˜. Eight circumscribing measurements are regarded as a cube:
 Tianshu Qu, Zheng Xiao, Mei Gong, Ying Huang, Xiaodong Li, and Xihong Wu. Distance-Dependent Head-Related Transfer Functions Measured With High Spatial Resolution Using a Spark Gap. IEEE Trans. on Audio, Speech & Language Processing, 17(6): 1124–1132, 2009.
 J. Villegas. Locating virtual sound sources at arbitrary distances in real-time binaural reproduction. Virtual Reality, 19(3):201–212, Oct 2015.