JMeter5.2 中文亂碼情況之beanshell加密加簽後中文亂碼
阿新 • • 發佈:2020-12-31
SpeechInputHandler
文件上是說註冊KeyWord的方式取代建立controllers,但是我試了試沒什麼用,個人推測是SpeechHandler裡面的命令配置沒有你要註冊的KeyWord也就是這是兩個檔案,但是SpeechInputHandler對這個命令也沒有報錯,有待考究。
貼下過程:
- 在speech input裡面註冊你的keyword
- 新增元件SpeechInputHandler。新增你的keyword,設定它的方法。
- 然後進行部署
實現介面 IMixedRealitySpeechHandler
public class 名字 : MonoBehaviour, Microsoft.MixedReality.Toolkit.Input.IMixedRealitySpeechHandler { bool registeredForInput = false; /// <summary> /// 表示這個需要偵聽 /// </summary> private void OnEnable() { if (!registeredForInput) { if (CoreServices.InputSystem != null) { CoreServices.InputSystem.RegisterHandler<IMixedRealitySpeechHandler>(this); registeredForInput = true; } } } /// <summary> /// 表示這個不用偵聽了 /// </summary> private void OnDisable() { if (registeredForInput) { CoreServices.InputSystem.UnregisterHandler<IMixedRealitySpeechHandler>(this); registeredForInput = false; } } public void OnSpeechKeywordRecognized(SpeechEventData eventData) { switch (eventData.Command.Keyword.ToLower()) { case "命令": 方法(); break; } } }
參考
https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/Input/Speech.html?q=Speech