Software Archive
Read-only legacy content
17061 Discussions

Possible bug in voice recognition module

Alain_Labrie
Beginner
528 Views
We are putting together the finishing touches on our entry, and I noticed a bug. 

Turning off voice recognition only seems to pause the messages from being sent to the handler. 
Take a look at the code below.

        bool toggleAudioProcessing()
        {
                g_bAwake = !g_bAwake;

                if(g_bAwake)
                        g_vrec->StartRec(g_source, g_handler);
                else
                        g_vrec->StopRec();

                return g_bAwake;
        }
When the voice recognition gets toggled back on, the handler gets flooded with whatever commands were 
said while the app was paused. 

Is there a way to stop this from happening?
0 Kudos
4 Replies
samontab
Valued Contributor II
528 Views

Workaround: Attach a the current system time to each command, and save the time for when you pause and resume the app. Then, ignore any command that is between pause app and resume app.

0 Kudos
Alain_Labrie
Beginner
528 Views

Thanks,

I decided to use a flag inside the handler instead. If it's false no commands are sent to the app. Since StopRec() only seems to pause the handler and not the underlying processing then there is no reason to call it. Either you deal with the commands as they come or you will be hit with a blob of commands when you call StartRec(). Either way you still have to process the same number of commands.

I hope this will be addressed in a future release.

 

0 Kudos
Xusheng_L_Intel
Employee
528 Views

Thanks for supporting RealSense SDK and we will fix this issue in the future. 

0 Kudos
Michail_S_Intel
Employee
528 Views

 

You may reinitialize g_source each time or use g_vrec->StartRec(NULL, g_handler); as a workaround. We will fix this issue in the future.

Mike.

0 Kudos
Reply