隐藏

neospeech语音库在c#中怎么用

发布:2021/2/7 10:54:15作者:管理员 来源:本站 浏览次数:1128

装完发声引擎后,可以在控制面板选NEOSPEECH发声引擎为系统默认发声引擎。

具体怎么调用,我还没弄清楚。

VM Paul是引擎的名字,用下面的代码可以调用。我用VS2010做的。

using System;
using System.Collections.Generic;
using System.Speech.Synthesis;


namespace Speach
{
    class Program
    {
        static void Main(string[] args)
        {
            SpeechSynthesizer synth = new SpeechSynthesizer();
            synth.Rate = 0;
            synth.Volume = 100;
            synth.SelectVoice("VW Paul");
           // synth.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult);
            synth.Speak("It is an essential principle that we must combine theory with practice");
            synth.Dispose();  
        }
    }
}