Solo
New member
I currently have in test operation a program written in VB that uses SAPI for speech and the speech recognition facility. The PC is connected to a hardware device that the user will occasionally send hardware commands to by speaking into a mic. The program reports on the results of the operations by speaking to the user. All that works just fine. There's a limited grammar of about 25 words that are defined to the speech recognition engine. The issue is that the user in this situation is speaking continually to another person and in the course of his speaking would say one of the words defined in the grammar and thus cause the program to react. What's needed is a keyword that wouldn't turn up in the user's normal speech that he would say prior entering a spoken command. It would function much like the Alexa device where the user would first say "Alexa" before saying a command. So, the question is how to implement that function. (Don't need the code, just the approach).
One approach might be to alter the grammar available to the speech recognition engine. On startup, the engine grammar would contain only the Alexa key word. When that word was recognized, the program would add to the grammar all the other words that could be recognized. But, it's not clear to me how then I could return the grammar to just the single key word after the detailed processing was finished. There are ways to add to the grammar, but I couldn't find a way to subtract from the grammar. I suppose that I could just stop the engine and then restart it with just the single word in the grammar.
Another approach might be to start two separate speech recognition engines, one with a one word grammar and one with the full grammar. The full grammar engine could be stopped and started by the code associated with the one word grammar. But, it's not clear whether you can have two speech recognition engines operating at one time, nor if the same mic input could be used for both.
Any suggestions on the best solution for this?
One approach might be to alter the grammar available to the speech recognition engine. On startup, the engine grammar would contain only the Alexa key word. When that word was recognized, the program would add to the grammar all the other words that could be recognized. But, it's not clear to me how then I could return the grammar to just the single key word after the detailed processing was finished. There are ways to add to the grammar, but I couldn't find a way to subtract from the grammar. I suppose that I could just stop the engine and then restart it with just the single word in the grammar.
Another approach might be to start two separate speech recognition engines, one with a one word grammar and one with the full grammar. The full grammar engine could be stopped and started by the code associated with the one word grammar. But, it's not clear whether you can have two speech recognition engines operating at one time, nor if the same mic input could be used for both.
Any suggestions on the best solution for this?