语音识别在Unity Hololens项目中不起作用 [英] Speech recognition doesn't work in Unity Hololens project
问题描述
我正在用Hololens创建自己的带有语音识别功能的Unity项目.我复制了教程中的说明.
I'm trying to create my own Unity project with speech recognition in Hololens. I copy pasted the instructions from tutorial.
从字面上将粘贴的SpeechManager.cs
文件和SphereCommands.cs
文件复制到我的项目中,但不会出错.我尝试在其中加入一些声音:
KeywordRecognizer_OnPhraseRecognized
看看我是否到达那里(甚至在调用任何东西之前),但我不知道.
Literally copy pasted the SpeechManager.cs
file and SphereCommands.cs
file to my project but it won't budge. I tried putting some sounds in:
KeywordRecognizer_OnPhraseRecognized
to see if I get there (even before invoking anything), but I don't.
我启动了keywordRecognizer.Start()
(还添加了声音以确保我在那里),但是我不知道它以后是否能正常工作.
I start the keywordRecognizer.Start()
(also added sounds to make sure I was there) but I have no idea if it's working afterwards.
该机器本身可以工作,因为如果我打开Origami程序,它可以毫无问题地识别我的声音.另外,在程序中说嘿Cortana"也可以.
The machine itself works, because if I open the Origami program, it recognizes my voice without issues. Also, saying "Hey Cortana" from the program also works.
我会复制代码,但这只是教程中的文件(甚至是短语).
I would copy the code, but it's just the file from the tutorial (even the phrases).
推荐答案
正如Nikolay在评论中所写,答案是我没有在Unity项目(编辑->项目设置->播放器)中启用麦克风. 我还必须删除UWP目录,并在Unity中进行重建,因为它将有意义.
As Nikolay wrote in the comments, the answer is that I didn't enable the Microphone in the Unity Project (Edit -> Project Settings -> Player). I also had to remove the UWP directory and rebuild in Unity is it will be relevant.
这篇关于语音识别在Unity Hololens项目中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!