Adding spatial sound to GameObjects

We have set the default settings and applied import settings to the sounds we want to use. Now, we will finally make some noise. It is time to allow your objects in your game to be heard.

We have been working on the RockOn app, where we can place guitars in our scenes by looking at a point and making the air tap gesture. You may have chosen another instrument, but the principle remains the same.

We have added the sound we want to play to our assets and set the general audio settings to the correct values.

The Assets folder in our project has GuitarPrefab. This is the prefab we created earlier, the object that gets instantiated. If you select the prefab in the Assets folder, you can choose Add Component ...

Get Microsoft HoloLens Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.