Created
October 21, 2024 13:15
-
-
Save pushkarsingh019/1f73dbb2b840f1b2c38e87ff82c6f370 to your computer and use it in GitHub Desktop.
Creating Sounds with HRTF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import slab | |
| import slab.sound | |
| slab.set_default_samplerate(44100) | |
| hrtf = slab.HRTF.kemar() | |
| white_noise = slab.Sound.whitenoise(duration = 2.0) | |
| white_noise_binaural = slab.Binaural(white_noise) | |
| angle = 80 | |
| filter = hrtf[angle] | |
| right_80 = filter.apply(white_noise_binaural) | |
| left_80 = slab.Binaural([right_80.right, right_80.left]) | |
| right_80.write('right_80.wav') | |
| left_80.write('left_80.wav') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment