Click here to Skip to main content
15,884,298 members
Home / Discussions / C#
   

C#

 
AnswerMessage Removed Pin
7-Dec-15 16:38
professionalBillWoodruff7-Dec-15 16:38 
GeneralMessage Removed Pin
7-Dec-15 16:43
Eilson Tang7-Dec-15 16:43 
GeneralMessage Removed Pin
7-Dec-15 16:56
professionalBillWoodruff7-Dec-15 16:56 
QuestionThreads and Dispatcher Pin
Member 121764286-Dec-15 6:23
Member 121764286-Dec-15 6:23 
AnswerRe: Threads and Dispatcher Pin
Richard Deeming7-Dec-15 1:22
mveRichard Deeming7-Dec-15 1:22 
Questionhow Select a DataGridView row after TextBox value c# Pin
Carlos_paiva5-Dec-15 0:58
Carlos_paiva5-Dec-15 0:58 
AnswerRe: how Select a DataGridView row after TextBox value c# Pin
OriginalGriff5-Dec-15 1:23
mveOriginalGriff5-Dec-15 1:23 
QuestionMaking a program that converts speech to text Pin
Member 120871384-Dec-15 19:10
Member 120871384-Dec-15 19:10 
C#
so I got the code from the msdn website:
https://msdn.microso...udiostream.aspx , just to check and see if everything is working. 
and since i do not have the wav file specified in the original code i downloaded my own wav file and inserted the address of it.
the program works but it prints out something completely different words that are not even in the wav file audio.


here is the code


C#
using System;
using System.Globalization;
using System.IO;
using System.Speech;
using System.Speech.AudioFormat;
using System.Speech.Recognition;
using System.Threading;

namespace InputExamples
{
    class Program
    {
        // Indicate whether asynchronous recognition is complete.
        static bool completed;

        static void Main(string[] args)
        {
            using (SpeechRecognitionEngine recognizer =
              new SpeechRecognitionEngine(new CultureInfo("en-US")))
            {

                // Create and load a grammar.
                Grammar dictation = new DictationGrammar();
                dictation.Name = "Dictation Grammar";

                recognizer.LoadGrammar(dictation);

               //Configure the input to the recognizer.

                recognizer.SetInputToWaveStream(
            File.OpenRead(@"C:\Users\Qasim\Desktop\wav3.wav"));


               //recognizer.SetInputToAudioStream(
                  //File.OpenRead(@"C:\Users\Qasim\Desktop\wav3.wav"),
                  //new SpeechAudioFormatInfo(
                    //44100, AudioBitsPerSample.Sixteen, AudioChannel.Mono));

                // Attach event handlers.
                recognizer.SpeechRecognized +=
                  new EventHandler<SpeechRecognizedEventArgs>(
                    SpeechRecognizedHandler);
                recognizer.RecognizeCompleted +=
                  new EventHandler<RecognizeCompletedEventArgs>(
                    RecognizeCompletedHandler);

                // Perform recognition of the whole file.
                Console.WriteLine("Starting asynchronous recognition...");
                completed = false;
                recognizer.RecognizeAsync(RecognizeMode.Multiple);

                while (!completed)
                {
                    Thread.Sleep(333);
                }
                Console.WriteLine("Done.");
            }

            Console.WriteLine();
            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }

        // Handle the SpeechRecognized event.
        static void SpeechRecognizedHandler(
          object sender, SpeechRecognizedEventArgs e)
        {
            if (e.Result != null && e.Result.Text != null)
            {
                Console.WriteLine("  Recognized text =  {0}", e.Result.Text);
            }
            else
            {
                Console.WriteLine("  Recognized text not available.");
            }
        }

        // Handle the RecognizeCompleted event.
        static void RecognizeCompletedHandler(
          object sender, RecognizeCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                Console.WriteLine("  Error encountered, {0}: {1}",
                  e.Error.GetType().Name, e.Error.Message);
            }
            if (e.Cancelled)
            {
                Console.WriteLine("  Operation cancelled.");
            }
            if (e.InputStreamEnded)
            {
                Console.WriteLine("  End of stream encountered.");
            }

            completed = true;
        }
    }
}

AnswerRe: Making a program that converts speech to text Pin
BillWoodruff4-Dec-15 22:55
professionalBillWoodruff4-Dec-15 22:55 
Questionhow to update the datagrid present on c# gui from c# dll. Pin
Member 93228874-Dec-15 7:49
Member 93228874-Dec-15 7:49 
AnswerRe: how to update the datagrid present on c# gui from c# dll. Pin
Eddy Vluggen4-Dec-15 7:58
professionalEddy Vluggen4-Dec-15 7:58 
AnswerRe: how to update the datagrid present on c# gui from c# dll. Pin
OriginalGriff4-Dec-15 8:02
mveOriginalGriff4-Dec-15 8:02 
AnswerRe: how to update the datagrid present on c# gui from c# dll. Pin
OriginalGriff4-Dec-15 8:24
mveOriginalGriff4-Dec-15 8:24 
QuestionSending emails Pin
Mohammad Imran Ahmed4-Dec-15 1:29
professionalMohammad Imran Ahmed4-Dec-15 1:29 
AnswerRe: Sending emails Pin
Eddy Vluggen4-Dec-15 1:57
professionalEddy Vluggen4-Dec-15 1:57 
AnswerRe: Sending emails Pin
CHill604-Dec-15 2:16
mveCHill604-Dec-15 2:16 
AnswerRe: Sending emails Pin
Afzaal Ahmad Zeeshan4-Dec-15 3:16
professionalAfzaal Ahmad Zeeshan4-Dec-15 3:16 
QuestionSMS Generation Pin
Mohammad Imran Ahmed4-Dec-15 1:27
professionalMohammad Imran Ahmed4-Dec-15 1:27 
AnswerRe: SMS Generation Pin
Richard MacCutchan4-Dec-15 2:01
mveRichard MacCutchan4-Dec-15 2:01 
AnswerRe: SMS Generation Pin
CHill604-Dec-15 2:18
mveCHill604-Dec-15 2:18 
QuestionABCPDF library and using dll Pin
Mol4ok3-Dec-15 23:48
Mol4ok3-Dec-15 23:48 
AnswerRe: ABCPDF library and using dll Pin
OriginalGriff4-Dec-15 0:06
mveOriginalGriff4-Dec-15 0:06 
GeneralRe: ABCPDF library and using dll Pin
Member 1198551412-Mar-18 1:29
Member 1198551412-Mar-18 1:29 
GeneralRe: ABCPDF library and using dll Pin
OriginalGriff12-Mar-18 1:38
mveOriginalGriff12-Mar-18 1:38 
QuestionHow to make a list that contain lists which contain lists Pin
kmkmahesh3-Dec-15 20:53
professionalkmkmahesh3-Dec-15 20:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.