O'Reilly logo

Microsoft HoloLens Developer’s Guide by Dennis Vroegop

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the library

The Git repository that contains the SpatialSoundPlayer also contains a sample project. This is just the standard spinning cube sample; however, now, when you tap to position the cube, it will also make a noise, coming from that cube.

Let's investigate how this works.

Open the HoloSoundsMain.cs file. I have a new private member here:

private SpatialSound _spatialSound;

This is our component. In the SetHolographicSpace method, you see how I initialize it. I give it RoomType and a file it can process. Of course, the ping.wav file is part of the app as well:

_spatialSound = new SpatialSound();_spatialSound.SetRoomType(RoomType.Medium);_spatialSound.Initialize(@"Assets/Sounds/ping.wav");In the Dispose we clean up after ourselves: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required