Software Archive
Read-only legacy content

Any C++ Sample of Voice Recognition without UI

CLi37
Beginner
1,131 Views

I tried to remove all UI code from the C++ Sample of Voice Recognition, my code was compiled fine, but it crasthed when I run it.

I used it as below

 g_session = PXCSession::CreateInstance();
 if (!g_session) {
  MessageBoxW(0, L"Failed to create an SDK session", L"Voice Recognition", MB_ICONEXCLAMATION | MB_OK);
  return 1;
 }

 // 1. Create Voice Recognition
 Start(nullptr);


 

0 Kudos
4 Replies
Piotr_P_
Beginner
1,131 Views

can you add more code that you used, because it seems incomplete. Have you tried run voice recognition with samples from documentation?

 

0 Kudos
AndreCarlucci
Beginner
1,131 Views

 

If you want to use C# instead of C++, it's as simple as:

    ICamera cam = Camera.Create();
    cam.Speech.SpeechRecognized += (s, a) => {
        Console.WriteLine("-> " + a.Sentence);
    };
    cam.Speech.EnableRecognition();

Download the nuget using: Install-Package SharpSenses.RealSense

Cheers!

0 Kudos
CLi37
Beginner
1,131 Views

The C# code is what I expected, it is cute. Unfortunately my other codes are C++. I think C++ speech recognition code is not complicated. since I just need only Command not Dictionary. 

I uploaded my modified voice_recognition.cpp and .h code. It is just tried to add predefined two commands "one", "two" inside. All GUI is disabled. I debugged and run it fine but in the end of the execution, it crashed. There may have something wrong in configuration.

 

 

0 Kudos
CLi37
Beginner
1,131 Views

I put voice recognition to a new thread and added stop detection my voice code worked. However I can not capture the Command "one" that was set. The SPEECH_UNRECOGNIABLE and VOLUME_LOW were displayed.

 

0 Kudos
Reply