Closed tletie closed 9 months ago
We appear to be running into this issue. Has this been resolved all?
@ARGs-code We're able to fix it with the Unity 2019 update but some time updating the HL OS result in the same situation. We tried 2020 LTS and it seems to be working with that.
We are on 2020.3.30f1 and still having this issue.
@ARGs-code Also I forgot to mention you need to enable and disable the MRTK speech handle.
Here is the code `
private bool registered;
void Awake()
{
UnityEngine.WSA.Application.windowActivated += ReRegister;
}
private void ReRegister(WindowActivationState state)
{
switch (state)
{
case WindowActivationState.CodeActivated:
UnRegister();
Register();
break;
case WindowActivationState.Deactivated:
UnRegister();
break;
case WindowActivationState.PointerActivated:
break;
default:
throw new ArgumentOutOfRangeException(nameof(state), state, null);
}
}
private void UnRegister()
{
if (registered)
{
if (CoreServices.InputSystem != null)
{
CoreServices.InputSystem.UnregisterHandler<IMixedRealitySpeechHandler>(this);
}
registered = false;
}
else
{
logger.Log(LogLevel.Error, "Keyword listener already unregistered");
}
}
private void Register()
{
if (!registered)
{
registered = true;
CoreServices.InputSystem.RegisterHandler<IMixedRealitySpeechHandler>(this);
}
else
{
logger.Log(LogLevel.Error, "Keyword listener already registered");
}
}
Ignore those unrelated logger statement.
Thanks for the suggestion @rsaru-libre
This work around doesn't fix my issue, despite executing all the calls.
@ARGs-code I've no words how to fix this one then. I fixed this issue using this script and then it works for 2-3 month but after certain hololens os update it stop working and then we looked into the unity2020 and seems to be working in the build. So I assume its something related to the HL OS version which is messing with the voice command.
No problem, it might not be the same issue. It is frustrating that these issues have just been closed, including the one I opened recently. Appreciate the help and your suggestions.
@ARGs-code I have used your code, but the problem still exists.
I solved the problem using the following script.
`using UnityEngine; using UnityEngine.Windows.Speech;
public class ApplicationBehaviour : MonoBehaviour { private void Awake() { DontDestroyOnLoad(gameObject); }
private void OnApplicationPause(bool pause)
{
if (!pause)
{
//Delayed restart of speech recognition
//Note: You must delay for a few seconds, otherwise it will not have any effect.
Invoke("RecongnitionRestart", 5);
}
}
// restart of speech recognition
private void RecongnitionRestart()
{
PhraseRecognitionSystem.Shutdown();
PhraseRecognitionSystem.Restart();
}
}`
We appreciate your feedback and thank you for reporting this issue.
Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority security issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.
Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.
Please note that MRTK3 was released in August 2023. It features an all-new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visit https://www.mixedrealitytoolkit.org.
Thank you for your continued support of the Mixed Reality Toolkit!
Describe the bug
Immersive application voice commands (utilize UnityEngine.Windows.Speech.KeywordRecognizer) stop working when user open other app like Edge, File Explorer while immersive application still running.
To reproduce
Steps to reproduce the behavior:
Expected behavior
While immersive app is running, if we launch other app like edge, file explorer, photo. Then we go back to immersive app and issue voice commands, it should works.
Your setup (please complete the following information)
Target platform (please complete the following information)