AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
MicrophoneHelperSample.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using UnityEngine;
5 
6 namespace HoloToolkit.Unity.Examples
7 {
8  public class MicrophoneHelperSample : MonoBehaviour
9  {
10  [Tooltip("Assign key to quickly test the microphone helper code")]
11  public KeyCode checkMicrophoneKey = KeyCode.M;
12 #if ENABLE_WINMD_SUPPORT
13  private async void Update()
14 #else
15  private void Update()
16 #endif
17  {
18  if(Input.GetKeyDown(checkMicrophoneKey))
19  {
20 #if ENABLE_WINMD_SUPPORT
21  var status = await MicrophoneHelper.GetMicrophoneStatus();
22 #else
24 #endif
25  Debug.LogFormat("Microphone status: {0}", status);
26  }
27  }
28  }
29 }
Provides a working status information of the default microphone on the system. Class is using UWP API...
static MicrophoneStatus GetMicrophoneStatus()
Stub function imitating the original GetMicrophoneStatus