Zoomicon / SpeechLib

Library for Speech Synthesis and Recognition using Windows.Speech or Microsoft.Speech and optionally Kinect V1 Sensor Microphone Array
MIT License
10 stars 4 forks source link

Kinect libraries are not available... #1

Closed jayjupdhig closed 2 years ago

jayjupdhig commented 2 years ago

Hi

I pulled your project via git clone to a folder then i opened the visual studio project with visual studio 2019 community edition. After clicking "build project map", i got that error:

image

Maybe somebody can explain me how to reach my goal - to complie the whole library?

thank you very much for your feedbacks. :-)

birbilis commented 2 years ago

Hi, do you have Kinect V1 SDK (not the V2 SDK for the redesigned 2nd-gen Kinect that came with Xbox One) installed? try installing first the 1.8 version from here: https://www.microsoft.com/en-us/download/details.aspx?id=40278

birbilis commented 2 years ago

...also if you see the details in that page it has a link to Kinect Developer Toolkit (can try installing that one too maybe)

It does mention the Microsoft Speech Platform, but the link it has there is broken

However this link might be related/helpful: https://www.microsoft.com/en-us/download/details.aspx?id=34809

Let me know if you have issues. Another idea is to remove the Kinect stuff from the library if you don't need it

jayjupdhig commented 2 years ago

Thank you very much for your fast feedback - will look on it ASAP! :-)

jayjupdhig commented 2 years ago

Now it compiles all - thank you very very much!! :-)

image

birbilis commented 2 years ago

In order to add some info about it at the readme of their repo, did you install just the Kinect V1 SDK or did you also install the Kinect V1 Toolkit and/or the language packs which I had mentioned as being separate links?

kosuodhmwa commented 2 years ago

I installed these two files, the lang pack is for german (de-DE):

we45rt62456

jayjupdhig commented 2 years ago

BTW.: When i compare (and try to adapt) the source code from with "original" SpeechRecognitionEngine class to your library...

`using System; using System.Globalization; using System.Speech.Recognition;

namespace ConsoleApp1 { class Program { private Program(string[] args) {
this.test(); }

    private void test()
    {
        // Create an in-process speech recognizer for the en-US locale.  
        using (
        SpeechRecognitionEngine recognizer =
          new SpeechRecognitionEngine(
            new System.Globalization.CultureInfo("de-DE")))
        {
            DictationGrammar dg = new DictationGrammar();

            // Create and load a dictation grammar.  
            recognizer.LoadGrammar(dg);

            // Add a handler for the speech recognized event.  
            recognizer.SpeechRecognized +=
              new EventHandler<SpeechRecognizedEventArgs>(recognizer_SpeechRecognized);

            // Configure input to the speech recognizer.  
            recognizer.SetInputToDefaultAudioDevice();

            // Start asynchronous, continuous speech recognition.  
            recognizer.RecognizeAsync(RecognizeMode.Multiple);

            // Keep the console window open.  
            while (true)
            {
                Console.ReadLine();
            }
        }
    }

    // Handle the SpeechRecognized event.  
    static void recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
    {
        Console.WriteLine("Recognized text: " + e.Result.Text);
    }

    static void Main(string[] args)
    {
        if(args == null)
        {
            args = new string[0];
        }

        new Program(args);
    }
}

}`

...then i see that your library does not accept any contructor arguments. So i can't add any language / culture info to the instance of SpeechRecognitionKinectV1 class:

´using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;

using System.Speech.Recognition; using SpeechLib.Recognition.KinectV1;

using System.Globalization;

namespace Spechlib_Example { class Program { private static DictationGrammar getDictationGrammar() { DictationGrammar dg = new DictationGrammar();

        return dg;
    }

    private Program(string[] args)
    {
        Console.WriteLine("TEST");

        using (
        SpeechRecognitionKinectV1 recognizer =
            new SpeechRecognitionKinectV1())
        {
            recognizer.LoadGrammar(Program.getDictationGrammar());
            recognizer.SpeechRecognitionEngine.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(recognizer_SpeechRecognized);
            recognizer.SetInputToDefaultAudioDevice();
            recognizer.SpeechRecognitionEngine.RecognizeAsync(RecognizeMode.Multiple);

            while (true)
            {
                Console.ReadLine();
            }
        }                     
    }

    // Handle the SpeechRecognized event.  
    static void recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
    {
        Console.WriteLine("Recognized text: " + e.Result.Text);
    }

    public static void Main(string[] args)
    {
        new Program(args);
    }
}

Maybe you can give me a hint?

jayjupdhig commented 2 years ago

(source code format from GitHub with ´-character seems to be a joke... so i'm sorry!! ;-))

jayjupdhig commented 2 years ago

Reopened - or do i have to create a new issue for my 2nd question?

birbilis commented 2 years ago

yes, better copy from here to separate issue and remove the unrelated comments from above thread

jayjupdhig commented 2 years ago

ok thx

birbilis commented 2 years ago

still see the unrelated stuff in this thread, if you still have that other issue, please make a new thread and move those (copy, then delete) comments from this thread to be able to follow up easily on each issue separately

kosuodhmwa commented 2 years ago

The problem was: "DictationGrammar" is completely unuseable (it's a MS-related issue, you are not responsible for that. Maybe it exists just for the future?), but with pre-defined works it works not bad... i just need to write some words in a "special" way (e.g. use 2 characters on some words instead of one etc.) then it works.

But "DictationGrammar" seems to by unuseable "by default" - many search results on google confirmed that.

birbilis commented 2 years ago

take a look at my SpeechTurtle and TrackingCam repos, where I was using this library in case there's any hint (search for references to the related classes there).

kosuodhmwa commented 2 years ago

thx!! :-)

birbilis commented 2 years ago

just noticed I had also added speech recoginition to my fork of HotSpotizer: https://github.com/birbilis/Hotspotizer/tree/master/Hotspotizer.WPF/Grammars

for the other two ones I mentioned see their grammars at: https://github.com/Zoomicon/TrackingCam/tree/master/TrackingCam/Grammars and https://github.com/Zoomicon/SpeechTurtle/tree/master/Grammars

jayjupdhig commented 2 years ago

Thank you very very much. Currently, it's OK with "static" (non-dictation) Grammar - but thank you anyway, now i know what i have to use if i have a specific use case! :-)