Skip to content

Commit b1fc46f

Browse files
author
Stephen Hodgson
committed
Updated TextToSpeech functionality
1 parent 9cf32be commit b1fc46f

File tree

9 files changed

+422
-2072
lines changed

9 files changed

+422
-2072
lines changed

Assets/HoloToolkit-Tests/Utilities/Scenes/TextToSpeechManager.unity

Lines changed: 323 additions & 1868 deletions
Large diffs are not rendered by default.

Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechManagerTest.cs

Lines changed: 0 additions & 69 deletions
This file was deleted.

Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechOnTap.cs

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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.InputModule.Tests
7+
{
8+
/// <summary>
9+
/// Tap Test for text to speech. This voice will appear to emanate from the object.
10+
/// </summary>
11+
public class TextToSpeechOnTapTest : MonoBehaviour, IInputClickHandler
12+
{
13+
private TextToSpeech textToSpeech;
14+
15+
private void Awake()
16+
{
17+
textToSpeech = GetComponent<TextToSpeech>();
18+
}
19+
20+
public void OnInputClicked(InputClickedEventData eventData)
21+
{
22+
// Create message
23+
var msg = string.Format(
24+
"This is the {0} voice. It should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.",
25+
textToSpeech.Voice.ToString());
26+
27+
// Speak message
28+
textToSpeech.StartSpeaking(msg);
29+
}
30+
}
31+
}

Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechOnTap.cs.meta renamed to Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechOnTapTest.cs.meta

File renamed without changes.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
using System;
6+
7+
namespace HoloToolkit.Unity.InputModule.Tests
8+
{
9+
public class TextToSpeechTest : MonoBehaviour
10+
{
11+
private TextToSpeech textToSpeech;
12+
13+
private void Awake()
14+
{
15+
textToSpeech = GetComponent<TextToSpeech>();
16+
}
17+
18+
public void SpeakTime()
19+
{
20+
// Say something using the text to speech manager on THIS test class (the "global" one).
21+
// This voice will appear to follow the user.
22+
textToSpeech.StartSpeaking("The time is " + DateTime.Now.ToString("t"));
23+
}
24+
}
25+
}

Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechManagerTest.cs.meta renamed to Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechTest.cs.meta

File renamed without changes.

0 commit comments

Comments
 (0)