Multiple SpeechInputSources in one Scene
Hello,
I want to detect different Keywords in my App. I want some Keywords to be only detactable upon some condition (eg Menu being open). So far I used the old KeywordsManager and was able to place multiple KeywordManagers in my scene starting and stoping them as needed.
I tried to do the same with the SpeechInputSource. Unfortunalty the second SpeechInputSource gets started, but the Keywords are not picked up. Along the SpeechInputSource I use the SpeechInputHandler to register the events for the keywords.
Has someone an idea how to handle this? Am I doing something wrong? Or can I just register all keywords in one SpeechInputSource and just enable/disable the corresponding SpeechInputHandlers? Or the other way round (multiple Sources, one Handler)?
Thanks in advance.
Hey @HoloFan, great questions here. I've done scenario 1, where I've put all my keywords on a single SpeechInputSource, but the use of multiple sources should work. Be sure you're registering your InputHandler as a GlobalListener with the InputManager, if the voice command doesn't require your gaze (You can do this by checking the box on the InputHandler). Also, if you're changing scenes and using the global listener flag, you'll need to use my updated PR to support persistent keywords https://github.com/Microsoft/HoloToolkit-Unity/pull/747.
@StephenHodgson : Thanks for your input.
I actually set up everything correctly but was calling StopKeywordRecognizer instead of StartKeywordRecognizer :/ After changing that everything works just fine. I think the new concept is well worth it and I like the idea of the SpeechInputHandler!
Hi, Not sure if it is ok to ask question in closed issue. But it is highly related to it.
I also try to use few SpeechInputSources and it works fine in general case. But SpeechInputHandler doesn't see Keywords from SpeechInputSource that is placed on the same game object. Use case - Main menu has a lot special buttons, I would like to place keywords and handlers on its prefab since they used only on menu.
Is it expected behavior?
Thanks.