matt-mekha / HRTF

A simple Head-Related Transfer Function demo made in Kotlin that allows you to hear sounds with direction and elevation just using stereo headphones.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HRTF Demo

A simple Head-Related Transfer Function demo made in Kotlin that allows you to hear sounds with direction and elevation just using stereo headphones.

Details

  • Frequency scaling based on the following variables: frequency, which ear, azimuth, and elevation.
  • Distance-based attenuation following the inverse square law.
  • Interaural time differences to simulate the speed of sound.

Features

  • Maximum of 1024 sample latency (about 22ms excluding any OS delays).
  • Can process frequencies of up to 22050 Hz.
  • SOFA file support for HRTF decoding.
  • Wave and MP3 file support for audio testing.

Try it yourself

  1. Download this JAR (from the latest release) and run the following command in the folder it's in:
java -jar HRTF.jar
  1. Select a SOFA file (see this repo's test-resources/HRTF folder or this database for examples).
  2. Select an audio file (see this repo's test-resources folder for examples).
  3. Press Run Demo and listen with headphones!

Credits

About

A simple Head-Related Transfer Function demo made in Kotlin that allows you to hear sounds with direction and elevation just using stereo headphones.


Languages

Language:Java 79.0%Language:Kotlin 21.0%