Search code examples
augmented-realityhololenswindows-mixed-reality

Capturing Sound Direction on Microsoft Hololens 2


I am considering purchasing a Microsoft Hololens 2 for some personal development projects, but before I do I would like to find some information regarding the microphones on the device.

  1. Are there any diagrams available that display where on the device the microphones are placed? I am having trouble figuring out where each one is placed based on the images I have seen. I could make a best guess, but if Microsoft has released an image making it clear, that would be potentially useful to me.
  2. Are the microphones on the device individual addressable?
  3. Do the Hololens/Microsoft APIs provide the capability to determine direction from which sound is originating?

I haven't done any development with Hololens since the first generation a few years back, so any information would be greatly appreciated!


Solution

  • Are there any diagrams available that display where on the device the microphones are placed? I am having trouble figuring out where each one is placed based on the images I have seen. I could make a best guess, but if Microsoft has released an image making it clear, that would be potentially useful to me.

    There is no official documentation show where the hololens2 microphone array placed for now. But I believe you should be able to find the pinholes of the five microphones on the device. There are three pinholes at the top front of HoloLens 2, which are microphones for capturing surrounding noise. And there are two microphones capture the user’s voice is hidden at the bottom of the glasses, they cooperate to isolate the user's voice from surrounding noise.

    For more detail, please refer to Alex Kipman's talk: Global Lecture 2019

    Are the microphones on the device individual addressable?

    Actually, when Hololens2 is capturing audio, it will create a mic audio stream including 5 channels.

    We can use Windows audio session (WASAPI) sample as the basis since utilizing WASAPI enabled us to have pretty granular control over what was happening (Scenario #4 in the sample)

    Then in WASAPICapture.cpp, making changes in the WASAPICapture::ActivateCompleted() function to change the mode / category while setting the AudioClientProperties

       audioProps.cbSize = sizeof(AudioClientProperties);
       audioProps.eCategory = AudioCategory_Media;
       audioProps.Options = AUDCLNT_STREAMOPTIONS_RAW;
       hr = m_AudioClient->SetClientProperties(&audioProps);
       if (FAILED(hr))
       {
           goto exit;
       }
    

    Finally, according to the following table, you can find out the corresponding channel of everyone from the microphone array

    Channel Mapping

    • Channel 1 – Top Left Mic

    • Channel 2 – Top Center Mic

    • Channel 3 – Top Right Mic

    • Channel 4 – Bottom Left Mic

    • Channel 5 – Bottom Right Mic

    Do the Hololens/Microsoft APIs provide the capability to Acoustic Localization from which sound is originating?

    Currently, Microsoft does not provide an official library/API to support Acoustic Localization for HoloLens. You can only implement it yourself or refer to other third-party libraries.