Unlike vision, humans hear in 360-degree surround sound. Spatial sound emulates how human hearing works, providing the cues needed to identify sound locations in world-space. When you add spatial sound in your mixed reality applications, you’re enhancing the level of immersion your user’s experience.
High-quality spatial sound processing is complex, so the HoloLens 2 comes with dedicated hardware for processing those sound objects. Before you can access this hardware processing support, you’ll need to install the MicrosoftSpatialSound plugin in your Unreal project. This article will walk you through the installation and configuration of the plugin and point you towards more in-depth resources.
The first step to adding spatial sound to your project is installing the Microsoft Spatial Sound plugin, which you can find by:
[!NOTE] If you haven’t already, you’ll need to install the Microsoft Windows Mixed Reality and HoloLens plugins by following the instructions in the Initializing your project section of our Unreal tutorial series.
Once the editor restarts, your project is all set!
Configuring the spatialization plugin is done on a per-platform basis. You can enable the Microsoft Spatial Sound plugin for the HoloLens 2 by:
If you’re going to be previewing your application in the Unreal editor on a desktop PC, you’ll need to repeat the above steps for the Windows platform:
Spatial audio is disabled by default on desktop versions of Windows. You can enable it by:
[!NOTE] This setting is only required if you plan to test your project in the Unreal editor.
After you’ve installed and configured the necessary plugins:
[!NOTE] The SoundAsset file needs to be mono to be spatialized with the Microsoft Spatial Sound plug-in. You can find the sound file properties by hovering over the asset in the Content Browser window as shown in the screenshot below.
When the sound asset is configured, the ambient sound can be spatialized using the dedicated hardware offload support on HoloLens 2.
Working with spatial audio means you’re in charge of managing how sound behaves in a virtual environment. Your main focus is creating sound objects that appear louder when the user is close, and quieter when the user is far away. This is referred to as sound attenuation, making sounds appear as if they’re positioned in a fixed spot.
All attenuation objects come with modifiable settings for:
Sound attenuation in Unreal has details and implementation specifics on each of these topics.
If you’re following the Unreal development journey we’ve laid out, you’re in the midst of exploring the MRTK core building blocks. From here, you can continue to the next building block:
[!div class=”nextstepaction”] Voice input
Or jump to Mixed Reality platform capabilities and APIs:
[!div class=”nextstepaction”] HoloLens camera
You can always go back to the Unreal development checkpoints at any time.