01-25-2010 04:34 PM
I have a main GUI VI that contains two listboxes. Both listboxes are selectable by the user. Here is how I want them to interact.
When the VI is initialized, the first listbox will be filled with string phrases. If the user double clicks a cell in the first listbox, the second listbox will be populated by sorting the string phrases from the first listbox to only include phrases starting with same first letter. Next, I want the user to be able to double click one of the phrases in the second listbox or 'say' the phrase into a microphone for speech recognition. The phrase that is double clicked in the second listbox or identified through speech recognized will then be displayed on the main GUI VI.
I've got my main GUI VI working such that the first listbox will populate the second listbox after the user double clicks a cell in the first listbox. I've also got it working such that I'm able to double click the second listbox and display the phrase. I'm using an event structure to do this thanks to some previous help from Dennis shown here. I've also got a decent VI working based on this example that will recognize a phrase spoken based on an array of possible input phrases (grammar builder). So I've got the pieces working independently of each other...
My question is how to have both the speech recognition listening and second listbox waiting for a double click for input at the same time? I have an event structure that waits for a double click to determine which phrase from the second listbox goes in the displayed phrase, I get that part, but how to use an event structure for speech recognition too? Do I need a button to click to start the speech recognition VI? I don't think I want the speech recognition VI running in the background just listening in some endless loop do I?
01-25-2010 06:45 PM
01-26-2010 01:54 AM - edited 01-26-2010 01:56 AM
It is a bit unclear what you are actually after. Yes you could use the speach recognition in a seperate loop running as a daemon / callback or something but what is to stop you coding both bits of code in the same event structure. You could do these in serial / parrallell just by the way you code them using dataflow. It definitiely shouldnt be block diagram space as you can always create sub vi's. You can deal with one of the events then create a user defined event to deal with the next process immediately after the first.
So to re-iterate, i am unsure as to what exactly you are after but i gave you my best guess 🙂
01-26-2010 01:33 PM
I'm confused too, so bare with me please.
Generally, I'm really confused about the proper way of getting different methods of user input at the same time.
If I'm not mistaken, the speech recognition will have to run in some sort of loop otherwise when it matches a phrase spoken with a phrase from the grammar building input array it will quit. I want the user to just be able to speech the next phrase after one has been recognized. However, if a loop is running inside the event structure, it will hang inside that loop until the loop is satsified. What if the user wants to say the heck with speech recognition at that point in time and double clicks an element in the listbox? They can't because the speech recognition loop has not been satisfied.
Hope that helps...I really need some help figuring out the correct way to put this together.
01-27-2010 11:45 AM
Posting to myself here...LOL
...does this mean I need parallel while loops?
01-27-2010 04:45 PM