Re: Programmatic control of Simon
Peter Grasch <[email protected]>
| Newsgroups | gmane.comp.kde.devel.accessibility |
|---|---|
| Message-ID | <3720017.Ko6YFoYVvi@eucleia> |
Hi Steve, Am Montag, 27. Februar 2012, 08:45:51 schrieb Steve: > I hope this is the right list for this request. Yes, it is :D > I'm working on a medical system that I hope will use Simon as its input > device for some aspects. That's cool. Would you mind telling us a little bit more about that? We are always interested to find out about practical applications of simon - especially in the medical field. > As not all of the aspects of the system will need VR I'd like to be able to > programmatically control when Simon is Active for VR and when it is not. Is > this possible? If so how do I do it? There are two options for that depending on what you want to accomplish. If your goal is to temporarily "disable" the recognition to re-enable it with a voice command (something like Dragons "go to sleep" / "wake up") then you can't really turn the recognition off but need to disable the command system temporarily. You can do that with the Filter command plugin (the scenario "[EN/VF] Recognition Control" does that for example - it's available through the scenario import). As you can trigger commands through DBus you can activate / de-activate the filter this way: Deactivate recognition (activate filter): qdbus org.simon-listens.ActionManager /ActionManager local.ActionManager.triggerCommand Filter "Activate Filter" Activate recognition (deactivate filter) qdbus org.simon-listens.ActionManager /ActionManager local.ActionManager.triggerCommand Filter "Deactivate Filter" As the filter just "filters out" commands, its scenario needs to be the first in the list to make sure it is consulted first in the command evaluation process. However, if you want to disable the recognition completely, you can deactivate simon like this: qdbus org.kde.simon /simon/MainWindow_1 org.kde.simon.SimonView.setActivation false And reactivate it with: qdbus org.kde.simon /simon/MainWindow_1 org.kde.simon.SimonView.setActivation false In contrast to the filtering approach, this will also stop the recording and sound segmentation. Best regards, Peter