Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
4 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
2
Question by SovietAlex · Aug 19, 2018 at 04:32 AM · backgroundspeechrecognitionruninbackground

Speech Recognition in background doesn't work correctly!

I am making a desktop application that needs to run in the background and the user can just say "Show me dog images" and it will pull up chrome with dog images.

But every time the chrome tab appears, speech recognition doesn't listen to user input anymore.

Sometime after the chrome tab opens I can say the command one more time and then it always stops listening after that.

I have (Run in Background) checked in player settings.

And when the application is in focus, it will continue to recognize everything I say, but once it is not in focus it doesn't work after some time.

Please help.

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.Windows.Speech;
 using System.Linq;
 
 public class Recognition : MonoBehaviour
 {
 
     public KeywordRecognizer keywordRecognizer;
     public Dictionary<string, System.Action> keywords = new Dictionary<string, System.Action>();
 
     void Start()
     {
         keywords.Add("open unity", () => { OpenUnityMethod(); });
         keywordRecognizer = new KeywordRecognizer(keywords.Keys.ToArray());
 
         keywordRecognizer.OnPhraseRecognized += KeywordRecognizerOnPhraseRecognize;
         keywordRecognizer.Start();
     }
 
     void Update()
     {
 
     }
 
 
     void KeywordRecognizerOnPhraseRecognize(PhraseRecognizedEventArgs args)
     {
 
         System.Action keywordAction;
 
         if (keywords.TryGetValue(args.text, out keywordAction))
         {
             keywordAction.Invoke();
         }
 
     }
 
 
     void OpenUnityMethod()
     {
         Application.OpenURL("http://unity3d.com/");
     }
 }

 
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 mikef · Sep 25, 2018 at 10:39 PM 0
Share

Same thing happening here, any info would be appreciated

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by lwwwwww · Oct 21, 2018 at 11:10 AM

I have the same problem。 Did you solve the problem?

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 SovietAlex · Oct 21, 2018 at 10:22 PM 0
Share

Well, I figured out why it does that. When you don't use one of the unity's components like audio source, background doesn't really work the way it should. When you do use audio source in the background to record speech it works perfectly but I don't know how to get that audio source into the speech recognition. What I did find was that google speech API allows you to pass in audio which will then work in the background.

avatar image
0

Answer by Weightless · May 04, 2020 at 01:05 PM

if anyone found a solution please share

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

93 People are following this question.

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

Related Questions

Microphone Input In Background 0 Answers

Oculus Quest Speech to Text API/SDKs that work 0 Answers

Code works in unity but throws errors in iOS. 0 Answers

How to use Chrome voice recognition api in Unity? 0 Answers

Avatar Speech Recognition in unity 3d 5.0.4 0 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