使用语音阅读邮件 [英] Reading mail using speech

查看:119
本文介绍了使用语音阅读邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个简单的语音识别程序,缺少的一件事是如何使用语音识别来读取邮件(gmail,outlook)并在收到新邮件时通知我?



从下面的评论中复制的其他信息

我希望当我在收件箱中收到+1消息时,该程序会通知我并询问我是否需要它阅读它。如果我这样做,程序将读取消息中的内容。我不知道怎么做,这是我想在程序中做的最后一件事。



这是代码(或至少部分代码)我的程序:



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:

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();
            }
}

推荐答案

开始使用语音识别 [ ^ ]。



Google [ ^ ]为您提供了许多良好的链接其中列出了许多Code Project文章。

你可以通过它们开始学习。



另见CodeProject [< a href =http://www.codeproject.com/search.aspx?q=Speech+%2B+c%23&x=-949&y=-162&sbo=kw&usfc=false target =_ blanktitle =New Window> ^ ]回复。



你有很好的要求,但你需要先学习并探索。尝试使用一些代码来完成任务。



如果您在编码时遇到任何困难,请随时回到这里,并针对描述该场景的特定问题提出另一个问题。



各位会员很乐意为您提供帮助。
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.


您可以使用POP客户端查看以下示例获取整个邮件到c#



C#.NET中的POP3客户端 [ ^ ]
you could use POP client see the example below to get the whole mail to c#

A POP3 Client in C# .NET[^]


这篇关于使用语音阅读邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆