Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
3.50/5 (3 votes)
See more:
I made a simple speech recognition program and the one thing that is missing is how to make it read mail (gmail,outlook) using speech recognition and to notify me when new message comes?

additional information copied from comment below
I want that program will notify me when I have +1 message in inbox and ask me if I want it to read it. If I do the program will read what's in the message. I don'tknow how to make that and it's the last thing I want to do in the program.

Here is the code (or at least part of it) of my program:

C#
using System.Diagnostics;
using System.Speech.Recognition;
using System.Speech.Synthesis;
using System.IO;

namespace JARVIS_1._3
{
    public partial class JARVIS : Form2
    {
        
        SpeechRecognitionEngine _recognizer = new SpeechRecognitionEngine();
        SpeechSynthesizer ALEXAI = new SpeechSynthesizer();

public JARVIS()
        {
            InitializeComponent();
            Choices searching = new Choices(System.IO.File.ReadAllLines(@"C:\Alex SR program\Alex.txt"));

            GrammarBuilder lookingService = new GrammarBuilder();
            lookingService.Append(searching);

            // Create a Grammar object from the GrammarBuilder and load it to the recognizer.
            Grammar googleGrammar = new Grammar(lookingService); ;
            _recognizer.RequestRecognizerUpdate();
            _recognizer.LoadGrammar(googleGrammar);

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

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

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

        void _recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            string time = now.GetDateTimeFormats('t')[0];
            int ranNum = rnd.Next(1, 25);
            string speech = e.Result.Text;
if (speech == "Hello")
            {
                ALEXAI.Speak("Hello sir!");
            }
            else if (speech == "Goodbye")
            {
                ALEXAI.Speak("Until next time");
                Application.Exit();
            }
}
Posted
Updated 17-Jan-14 22:17pm
v3
Comments
Nelek 18-Jan-14 3:38am    
And where are oyou having problems? Connecting to email provider? To know when new email come? to say that a new email came? somewhere else?
A bit more concrete information will help people understanding your problem and make easier for them to help you
Keno995 18-Jan-14 3:40am    
I want thhat program will notify me when I have +1 message in inbox and ask me if I want it to read it. If I do the program will read what's in the message. I don'tknow how to make that and it's the last thing I want to do in the program.
Mitchell J. 18-Jan-14 3:53am    
So you haven't done anything so far in this matter... and you need a general direction?
Keno995 18-Jan-14 3:57am    
Yes, I don't know how to make that so if there is any help, there must be everything.

Start from Get Started with Speech Recognition[^].

Google[^] gives you many good links out of which there are many Code Project articles listed.
You can start learning by going through them.

Also see how CodeProject[^] replies.

You have nice requirements, but you need to study first and explore. Try some code to achieve the task.

If you face any difficulty while coding, feel free to come back here and ask another question with specific issue describing the scenario.

Members will be happy to help you then.
 
Share this answer
 
you could use POP client see the example below to get the whole mail to c#

A POP3 Client in C# .NET[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900