简体   繁体   English

在 Unity3D 中使用简单的语音命令(使用 IBM Watson SDK)

[英]Using Simple Voice Commands in Unity3D (with IBM Watson SDK)

The problem问题

I'm currently using Speech-To-Text from the IBM Watson SDK for Unity to recognize voice commands like start or quit by just checking if the recognized text contains one of them.我目前正在使用IBM Watson SDK 中的 Speech-To-Text for Unity来识别语音命令,例如开始退出,只需检查识别的文本是否包含其中之一。

Problem is that it doesn't work very reliable (output is often spot or hit ) and I really just need those simple commands.问题是它不是很可靠(输出通常是spothit ),我真的只需要那些简单的命令。

What I tried我试过的

Alternatively I already tried using UnityEngine.Windows.Speed;或者我已经尝试过using UnityEngine.Windows.Speed; but I need it to work on both Windows and Mac .但我需要它同时在 Windows 和 Mac 上工作 I couldn't find a good and working Mac solution and I tried writing my own Unity plugin with Xcode and NSSpeechRecognizer similar to this Tutorial but that didn't work for me.我找不到一个好的和有效的 Mac 解决方案,我尝试使用类似于本教程的 Xcode 和NSSpeechRecognizer编写我自己的 Unity 插件,但这对我不起作用。

I also saw Snowboy for hotword detection.我还看到了Snowboy用于热词检测。 But it requires a lot of setup and I would really wish for an easy and reliable solution.但它需要大量设置,我真的希望有一个简单可靠的解决方案。

Thanks in advance.提前致谢。

You should use both Watson Speech to Text and Assistant services for this use case.对于此用例,您应该同时使用 Watson Speech to Text 和 Assistant 服务。 You can train an instance of Assistant to understand phrases like "start", "go", "initialize", etc to return an intent of START and phrases like "stop", "quit", "halt", etc to return an intent of QUIT .您可以训练 Assistant 实例来理解“start”、“go”、“initialize”等短语以返回START的意图,以及“stop”、“quit”、“halt”等短语以返回意图的QUIT You can then send transcription of Speech to Text to the Assistant service which will return an intent of START or QUIT and execute game logic based on the returned intent.然后,您可以将 Speech to Text 的转录发送到 Assistant 服务,该服务将返回STARTQUIT的意图,并根据返回的意图执行游戏逻辑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM