Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by RaniaSaeed · Feb 07, 2017 at 05:42 PM · unity5speech

Error: there already is a keyword recognizer with "go" as one of its keyword UnityEngine.Windows.Speech.KeywordRecognizer:.ctor(String[])

I'm Trying to make speech recognition with KeywordRecognizer and Microsoft.Speech but i got this error

Error: there already is a keyword recognizer with "go" as one of its keyword UnityEngine.Windows.Speech.KeywordRecognizer:.ctor(String[])

it sends me the same error even when i write a different word than go

this is my code: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Windows.Speech; using System.Linq;

 public class Recognition : MonoBehaviour {
 
     KeywordRecognizer KeywordRecognizer;
     Dictionary<string, System.Action> keywords = new Dictionary<string, System.Action>();
 
     void Start()
     {
 
         keywords.Add(" go ", () =>
         {
             GoCalled();
         });
         KeywordRecognizer = new KeywordRecognizer(keywords.Keys.ToArray());
         KeywordRecognizer.OnPhraseRecognized += KeywrodRecognizerOnPhraseRecognized;
         KeywordRecognizer.Start();
     }
 
     void KeywrodRecognizerOnPhraseRecognized(PhraseRecognizedEventArgs args)
     {
         System.Action keywordAction;
         if (keywords.TryGetValue(args.text , out keywordAction))
         {
             keywordAction.Invoke();
         }
     }
 
     void GoCalled()
     {
         print("you just said GO");
     }
 }
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tyodio-Prasetyo · Feb 09, 2017 at 09:52 PM 0
Share

got same problem here need help

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Influnza · Aug 02, 2017 at 04:38 AM

I was hitting hit this error when loading a new scene and creating a new recognizer. The error went away with:

 void OnDestroy()
 {
 if (keywordRecognizer != null)
   {
     keywordRecognizer.Stop();
     keywordrecognizer.Dispose();
   }
 }

I think even a better solution would be to create a singleton once (DontDestroyOnLoad)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Aug 02, 2017 at 05:03 AM 0
Share

This would have been my first assumption that you somehow create two or more at the same time. The $$anonymous$$eywordRecogniser wraps some native OS libraries, so make sure you only create one instance at any time. Even when you implement a singleton i would strongly recommend to keep that OnDestroy. Native resources should always be explicitly disposed. Never rely on the GC.

avatar image
0

Answer by sandbaydev · Jan 19, 2018 at 02:54 PM

Bit old question, but I had the same problem so I thought to add:

Make sure you start only ONE speech recognition script in the scene. If you have 2 objects with the script, you'll get that error.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to use custom TensorFlow speech recognition model in Unity3d? 0 Answers

talking tom audio record/playback tutorial 1 Answer

Speech to text 3rd party Libraries - Kaldi or Pocketsphinx? 1 Answer

Sending an HTTP POST request with JSON body 1 Answer

Unity 5 system requirements 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges