C# 使用微软语音播放类库实现语言播放功能

using System;
using System.Speech.Synthesis;

namespace OutSpeech
{
    class Program
    {
        static void Main(string[] args)
        {
            SpeechSynthesizer ssh = new SpeechSynthesizer();
            string content = "您好,欢迎语音转换功能。  请输入您的昵称";
            ssh.Speak(content);
            string input = Console.ReadLine();
            Console.WriteLine($"您好:{input}");
            ssh.Speak($"欢迎 {input} 使用语音功能");
            Console.ReadKey();
        }
    }
}

控制台实例。使用前需要右键引用-->添加引用-->如下图:-->才能使用SpeechSynthesizer这个类

C# 使用微软语音播放类库实现语言播放功能

剩下的交给你们自行扩展吧,,,在这只是简单的记录一下。