Skip to content

Commit 97fc82d

Browse files
Merge branch 'HTK-Master' into HTK-SharingIpConfigUx
2 parents 9d97666 + f2b5cda commit 97fc82d

30 files changed

+1856
-22
lines changed

Assets/HoloToolkit-Examples/InteractiveElements/Prefabs/Button.prefab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ MonoBehaviour:
461461
m_EditorClassIdentifier:
462462
InteractiveHost: {fileID: 0}
463463
ButtonLabels: {fileID: 114374334392891108}
464-
ColorThemeTag: buttonLableColor
464+
ColorThemeTag: buttonLabelColor
465465
PositionThemeTag: buttonLabelPosition
466466
MovePosition: {fileID: 114310027305425480}
467467
--- !u!114 &114000011132779576

Assets/HoloToolkit-Tests/Input/Scripts/MicStreamDemo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private void OnEnable()
9292
IsRunning = true;
9393
}
9494

95-
private void Start()
95+
private void Awake()
9696
{
9797
CheckForErrorOnCall(MicStream.MicInitializeCustomRate((int)StreamType, AudioSettings.outputSampleRate));
9898
CheckForErrorOnCall(MicStream.MicSetGain(InputGain));
@@ -109,7 +109,7 @@ private void Start()
109109

110110
print("MicStream selector demo");
111111
print("press Q to start stream to audio source, W will stop that stream");
112-
print("It will start a recording and save it to a wav file. S will stop that recording.");
112+
print("press A to start a recording and S to stop that recording and save it to a wav file.");
113113
print("Since this all goes through the AudioSource, you can mute the mic while using it there, or do anything else you would do with an AudioSource");
114114
print("In this demo, we start the stream automatically, and then change the size of the gameobject based on microphone signal amplitude");
115115
isRunning = true;

Assets/HoloToolkit/Input/Scripts/Editor/SpeechInputHandlerEditor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@ public class SpeechInputHandlerEditor : Editor
1313
{
1414
private SerializedProperty keywordsProperty;
1515
private string[] registeredKeywords;
16+
private SerializedProperty isGlobalListenerProperty;
1617

1718
private void OnEnable()
1819
{
1920
keywordsProperty = serializedObject.FindProperty("Keywords");
2021
registeredKeywords = RegisteredKeywords().Distinct().ToArray();
22+
isGlobalListenerProperty = serializedObject.FindProperty("IsGlobalListener");
2123
}
2224

2325
public override void OnInspectorGUI()
2426
{
2527
serializedObject.Update();
28+
EditorGUILayout.PropertyField(isGlobalListenerProperty);
29+
2630
ShowList(keywordsProperty);
2731
serializedObject.ApplyModifiedProperties();
2832

Assets/HoloToolkit/Input/Scripts/Interactions/TapToPlace.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ public class TapToPlace : MonoBehaviour, IInputClickHandler
3838
[Tooltip("Setting this to true will enable the user to move and place the object in the scene without needing to tap on the object. Useful when you want to place an object immediately.")]
3939
public bool IsBeingPlaced;
4040

41+
[Tooltip("Setting this to true will allow this behavior to control the DrawMesh property on the spatial mapping.")]
42+
public bool AllowMeshVisualizationControl = true;
43+
4144
/// <summary>
4245
/// The default ignore raycast layer built into unity.
4346
/// </summary>
@@ -124,7 +127,10 @@ private void HandlePlacement()
124127
InputManager.Instance.AddGlobalListener(gameObject);
125128

126129
// If the user is in placing mode, display the spatial mapping mesh.
127-
SpatialMappingManager.Instance.DrawVisualMeshes = true;
130+
if (AllowMeshVisualizationControl)
131+
{
132+
SpatialMappingManager.Instance.DrawVisualMeshes = true;
133+
}
128134
#if UNITY_WSA && !UNITY_EDITOR
129135

130136
//Removes existing world anchor if any exist.
@@ -139,7 +145,10 @@ private void HandlePlacement()
139145
InputManager.Instance.RemoveGlobalListener(gameObject);
140146

141147
// If the user is not in placing mode, hide the spatial mapping mesh.
142-
SpatialMappingManager.Instance.DrawVisualMeshes = false;
148+
if (AllowMeshVisualizationControl)
149+
{
150+
SpatialMappingManager.Instance.DrawVisualMeshes = false;
151+
}
143152
#if UNITY_WSA && !UNITY_EDITOR
144153

145154
// Add world anchor when object placement is done.

Assets/HoloToolkit/Input/Scripts/Microphone/MicStream.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
using System.Runtime.InteropServices;
5-
using UnityEngine;
65
using System.Text;
6+
using UnityEngine;
77

88
namespace HoloToolkit.Unity.InputModule
99
{
1010
public class MicStream
1111
{
12-
// This class replaces Unity's Microphone object
13-
// This class is made for HoloLens mic stream selection, but should work well on all windows 10 devices
14-
// chooses from one of three possible microphone modes on HoloLens
15-
// There is an example of how to use this script in HoloToolkit\Input\Tests\Scripts\MicStreamDemo.cs
16-
17-
// Streams: LOW_QUALITY_VOICE is optimized for speech analysis, COMMUNICATIONS is higher quality voice and is probably preferred
18-
// ROOM_CAPTURE tries to get the sounds of the room more than the voice of the suer
19-
// can only be set on initialization
12+
// This class replaces Unity's Microphone object.
13+
// This class is made for HoloLens mic stream selection but should work well on all Windows 10 devices.
14+
// Choose from one of three possible microphone modes on HoloLens.
15+
// There is an example of how to use this script in HoloToolkit-Tests\Input\Scripts\MicStreamDemo.cs.
16+
17+
// Streams: LOW_QUALITY_VOICE is optimized for speech analysis.
18+
// COMMUNICATIONS is higher quality voice and is probably preferred.
19+
// ROOM_CAPTURE tries to get the sounds of the room more than the voice of the user.
20+
// This can only be set on initialization.
2021
public enum StreamCategory { LOW_QUALITY_VOICE, HIGH_QUALITY_VOICE, ROOM_CAPTURE }
2122

2223
public enum ErrorCodes { ALREADY_RUNNING = -10, NO_AUDIO_DEVICE, NO_INPUT_DEVICE, ALREADY_RECORDING, GRAPH_NOT_EXIST, CHANNEL_COUNT_MISMATCH, FILE_CREATION_PERMISSION_ERROR, NOT_ENOUGH_DATA, NEED_ENABLED_MIC_CAPABILITY };
@@ -192,4 +193,4 @@ public static bool CheckForErrorOnCall(int returnCode)
192193
return true;
193194
}
194195
}
195-
}
196+
}

Assets/HoloToolkit/Input/Scripts/SetGlobalListener.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using UnityEngine;
55

6-
namespace HoloToolkit.Unity.InputModule.Tests
6+
namespace HoloToolkit.Unity.InputModule
77
{
88
/// <summary>
99
/// Register this game object on the InputManager as a global listener.

Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public struct KeywordAndResponse
2222
[Tooltip("The keywords to be recognized and optional keyboard shortcuts.")]
2323
public KeywordAndResponse[] Keywords;
2424

25+
[Tooltip("Determines if this handler is a global listener, not connected to a specific gameobject")]
26+
public bool IsGlobalListener = false;
27+
2528
[NonSerialized]
2629
private readonly Dictionary<string, UnityEvent> responses = new Dictionary<string, UnityEvent>();
2730

@@ -44,6 +47,10 @@ protected virtual void Start()
4447
responses.Add(keyword, keywordAndResponse.Response);
4548
}
4649
}
50+
if (IsGlobalListener)
51+
{
52+
InputManager.Instance.AddGlobalListener(gameObject);
53+
}
4754
}
4855

4956
void ISpeechHandler.OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)

Assets/HoloToolkit/Input/Models/Cursor/Materials.meta renamed to Assets/HoloToolkit/Sharing/Scripts/Extensions.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/HoloToolkit/Utilities/Scripts/SessionExtensions.cs renamed to Assets/HoloToolkit/Sharing/Scripts/Extensions/SessionExtensions.cs

File renamed without changes.

Assets/HoloToolkit/Utilities/Scripts/SessionExtensions.cs.meta renamed to Assets/HoloToolkit/Sharing/Scripts/Extensions/SessionExtensions.cs.meta

File renamed without changes.

0 commit comments

Comments
 (0)