-2

I have an windows form app. I need to add speech recognition into it in order to shorten the processing time for product entry. we need this speech recognition in Turkish. if it was in english, because of wrong pronunciation it would give a lot of false results. So we need in Turkish. But windows offline speech recognition engine doesnt support Turkish.

Actually We need max 100 keywords in order to succeed this. we don't need whole language in process. So if I can create a language by adding a word and train the engine for that with a kind of training as speech training in windows, it would be great.

So I need guidance to start or move forward for this task. I have looked at the cmusphnfix but it doesnt have turkish language also. But I dont know if I can create a custom language for 100 words with correct pronunciation. if so how can ı do it in c#.

note: we dont want to use google and microsoft online services. we are looking other options.

Thanks in advance.

smoothumut
  • 3,423
  • 1
  • 25
  • 35
  • 1
    looks like you found a gap in the market for Turkish speech recognition...But this type of question is off-topic for stack overflow. here we answer concrete questions about code like exceptions, syntax etc. how would you answer any answer correct when any answer would have to be opinion based? – jazb Nov 07 '18 at 12:24

4 Answers4

1

Windows desktop versions have built in APIs for speech recognition. These include grammar support for identifying the words or meaning of what was spoken. I don't know if Turkish is supported.

Perhaps https://stackoverflow.com/a/5473407/90236 or https://learn.microsoft.com/en-us/previous-versions/office/developer/speech-technologies/hh361633(v%3doffice.14) can help you get started

Michael Levy
  • 13,097
  • 15
  • 66
  • 100
1

https://www.sestek.com has good Turkish speech recognition. As for 100 keywords, on that scale it is easier to recognize whole speech and just look for keywords in transcription. That will give you better accuracy because speech recognition uses more context. When you just look for keywords you do not have context so the recognition is actually less accurate.

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
0

write this:

using System;
using System.Runtime.CompilerServices;
using System.Speech.Recognition;
using System.Speech.Synthesis;
using System.Threading;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.IO;
using System.Linq.Expressions;

namespace speechrecognition
{
    class Program
    {
        static string a { get; set; }

        static void Main(string[] args)
        {
             recognize();
         }
        static void recognize()
        {
             SpeechRecognitionEngine recognizer = new SpeechRecognitionEngine();
            Choices colorChoice = new Choices(new string[] { "gugl", "noutpad" });
            GrammarBuilder colorElement = new GrammarBuilder(colorChoice);
            Choices bothChoices = new Choices(new GrammarBuilder[] { colorElement });
            Grammar grammar = new Grammar((GrammarBuilder)bothChoices);
            recognizer.LoadGrammar(grammar);
            try
            {
                 recognizer.SetInputToDefaultAudioDevice();
                RecognitionResult result = recognizer.Recognize();
                try
                {
                    if (result.Text != null)
                    {
                         switch (result.Text.ToString())
                        {
                            // Here you add keywords like other two  
                            // and write the into choices color choice too
                            case "noutpad":
                                Process.Start(@"notepad.exe");
                                Console.WriteLine("Notepad opened!");
                                recognize();
                                break;
                            case "gugl":
                                Process.Start(@"chrome.exe");
                                Console.WriteLine("Google opened!");
                                recognize();
                                break;
                        }
                    }
                    else
                    {
                        Console.WriteLine("I dont hear you!");
                        recognize();
                    }
                }    
                catch (System.NullReferenceException)
                {
                    recognize();
                }
            }
            catch (InvalidOperationException exception)
            {
                Console.WriteLine("I dont hear you!");
                Console.ReadLine();
                recognize();
            }
            finally
            {
                recognizer.UnloadAllGrammars();
                recognize();
            }
        }
    }
}
Chris Catignani
  • 5,040
  • 16
  • 42
  • 49
0

this is script for C# console app if you want this in windows forms, just copy static void recognize and all in this and paste it in class Form : Form1, or where you want. write recognize(); in button1_click, or where you want. in windows forms do not copy anything else!