none
Speech to text - Italian support RRS feed

  • Question

  • Hi to all and thank you in advance for supporting me on this,

    I need to create an offline speech to text application that needs to recognise few vocal commands in english and/or italian.

    I've tried 2 libraries:

    -System.Speech.Recognition that works very well but it only recognise english commands and only when the windows language is setted to English;

    -Windows.Speech.Recognition that accept both Italian and English languages but give me the exception "Cannot find the requested data item, such as a data key or value." on the line "recEngine.SetInputToDefaultAudioDevice();".

    The required working environment is windows 10, 8.1 and 8; Olders are plus for my work.

    Have you any suggest?

    Thank you in advance,

    Regards,

    Giovanni
    Thursday, May 9, 2019 8:26 AM

Answers

  • Hi Giovanni,

    Thank you for posting here.

    For your question, you want to create a speech to text application that needs to recognize few vocal commands in English and Italian.

    Based on my research, you could try System.Speech.Recognition to recognize English and Italian both.

    First, it is necessary for you to install Italian language pack.

    Second, I write a simple code, you could have a look.

     static void Main(string[] args)
            {
                using (SpeechRecognitionEngine recognizer =new SpeechRecognitionEngine( new System.Globalization.CultureInfo("it-IT")))
                {
    
                    // Create and load a dictation grammar.  
                    recognizer.LoadGrammar(new DictationGrammar());
    
                    // 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();
                    }
                }
            }
            static void recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
            {
                Console.WriteLine("Recognized text: " + e.Result.Text);
            }

    If you want to change it to recognize English, you could change "it-IT" to "en-US".

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Friday, May 10, 2019 1:28 AM
    Moderator
  • Hi 

    Thanks for the feedback.

    You could refer to the following link to download Italian language packs.

    https://support.office.com/en-us/article/how-to-download-text-to-speech-languages-for-windows-10-d5a6b612-b3ae-423f-afa5-4f6caf1ec5d3​​​​​​​

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 15, 2019 5:44 AM
    Moderator

All replies

  • Hi Giovanni,

    Thank you for posting here.

    For your question, you want to create a speech to text application that needs to recognize few vocal commands in English and Italian.

    Based on my research, you could try System.Speech.Recognition to recognize English and Italian both.

    First, it is necessary for you to install Italian language pack.

    Second, I write a simple code, you could have a look.

     static void Main(string[] args)
            {
                using (SpeechRecognitionEngine recognizer =new SpeechRecognitionEngine( new System.Globalization.CultureInfo("it-IT")))
                {
    
                    // Create and load a dictation grammar.  
                    recognizer.LoadGrammar(new DictationGrammar());
    
                    // 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();
                    }
                }
            }
            static void recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
            {
                Console.WriteLine("Recognized text: " + e.Result.Text);
            }

    If you want to change it to recognize English, you could change "it-IT" to "en-US".

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Friday, May 10, 2019 1:28 AM
    Moderator
  • Thank you for your quick answer!

    I've already tried this way but setting Locale to "it-IT" gives me an error: it can't find the Locale id, but i've installed it..

    Can you share some links or websites where to download italian language packs?

    Thank you in advance,

    BR

    Tuesday, May 14, 2019 2:31 PM
  • Hi 

    Thanks for the feedback.

    You could refer to the following link to download Italian language packs.

    https://support.office.com/en-us/article/how-to-download-text-to-speech-languages-for-windows-10-d5a6b612-b3ae-423f-afa5-4f6caf1ec5d3​​​​​​​

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 15, 2019 5:44 AM
    Moderator