Thursday, September 18, 2014

Spatial Audio in Unity3D

I recently acquired an Oculus Rift.

It was easy to integrate into one of my existing projects, however during testing, I discovered Unity does not support 'surround sound' using stereo headphones.

After much research, trial and error I have found that getting 'true' (HRTF) surround sound really requires dedicated hardware. It's too expensive to run realtime on your CPU at the same time as your game.

I read that FMOD has a 'fake HRTF' implementation, however this is not exposed by Unity. Well, at least it can be faked right? After all, reality is not important, perception of reality is!

So I faked it. This is my SpatialAudioSource component.

www.differentmethods.com/packages/SpatialAudioSourceDemo.html

Just drag and drop the component onto any existing audio source. It also features audio occlusion. So if something gets between the Player and the AudioSource, the audio is altered accordingly.

When it's ready, I'll put it on the Asset Store.

No comments:

Popular Posts