Click here to Skip to main content
15,899,937 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I'm trying to write a voice control addon for a gamepad to be used with DirectInput. Basically, with the current functionality our application can only read whatever input the user is physically pressing on the gamepad at that time. We're playing with advanced alternative input methods such as voice commands but the application is not open source so it can only use controllers. Basically, what we'd like to be able to do is create a new HID driver and install the device into windows, settings the application to use it. Then, I'd like to hook all input from the 'real' physical controller and replicate it and send it along as if it came from the 'virtual' controller. I'd also like to have the 'virtual' controller's driver using a named pipe in memory (or other means) to watch for additional 'events' to send. So while holding both directional axis controls and pressing both hats, all of those inputs would reach the target, but we'd also like to be able to say "2" out loud and have the virtual gamepad send the same event inbound as if 2 was actually pressed. Before I set out to create this, has it been done already? Or is my plan not really possible due to any limitations I missed?

Note - I don't want to expand the functions of the gamepad, just have an alternative way of triggering events you can already do on it physically, using voice instead.
Posted

1 solution

The problem is solvable, I don't see any limitation. I am afraid you're going to have a design problem with your pipe or anything logically similar, then your system will be as malfunctional as many phone robot systems. Even if such ill-designed phone systems are barely tolerable, in gaming it may render the whole voice feature useless.

The problem is that with the pipe you will serialize voice requests for triggers. In this way, some commands will potentially be processed at later time when the command is already irrelevant (or worse, damaging) in the already-changed environment. This is very usual with voice control in particular.

A HID driver is a wrong level of abstraction, I think. (What do you want to use, System.Speech? It provides application-level API.)

So, I guess nobody will give you a code snippet to show the solution. You need 1) hire a competent application designer, 2) become such a designer by reading some books on gaming architectures (not necessarily with voice control).

Sorry if I misunderstood some of your ideas. I actually appreciate your formulation of the problem -- my 5.
 
Share this answer
 
v2
Comments
Espen Harlinn 26-Feb-11 10:52am    
Good reply - a 5
Sergey Alexandrovich Kryukov 26-Feb-11 20:21pm    
Thank you.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900