July 2017
Beginner to intermediate
390 pages
10h 53m
English
As you might have expected, our work in Unity3D is even simpler. Let me walk you through it.
Open the RockOn app. Add a new C# script to the Scripts folder, call it VoiceRecognizer, and attach that to the main camera.
The implementation looks as follows:
using UnityEngine; using UnityEngine.Windows.Speech; using Random = System.Random; public class VoiceRecognizer : MonoBehaviour { [Tooltip("The object you want to place")] public GameObject objectToPlace; private void Start() { var keywordRecognizer = new KeywordRecognizer(new[] {"Place"}); keywordRecognizer.OnPhraseRecognized += OnPhraseRecognized; keywordRecognizer.Start(); } private void OnPhraseRecognized(PhraseRecognizedEventArgs args) { var confidence ...Read now
Unlock full access