【问题标题】:Text-to-speech using Phonics Sounds使用 Phonics Sounds 的文本转语音
【发布时间】:2011-08-27 17:39:05
【问题描述】:

我怎样才能通过按任何字母键来获得语音?例如,我想通过按“A”键获得A 的拼音。

我正在使用 Microsoft SAPI v5.1。请您指出正确的方向吗?

【问题讨论】:

  • 您找到解决方案了吗?
  • 不........请帮帮我,我想获得拼音...不是正常的字母声音
  • 不确定我是否听懂了当您按下 A 键时,您希望听到什么声音? phonics 的声音是什么意思?

标签: c# .net c#-4.0 text-to-speech sapi


【解决方案1】:

添加对System.Speech 程序集的引用。

添加using System.Speech.Synthesis;

using (var speechSynthesizer = new SpeechSynthesizer())
{
    speechSynthesizer.Speak("A");
    speechSynthesizer.Speak("B");
    speechSynthesizer.Speak("C");
}

例如这样:

using (var speechSynthesizer = new SpeechSynthesizer())
{
    while (true)
    {
        var consoleKey = Console.ReadKey();
        if (consoleKey.Key == ConsoleKey.Escape)
            break;
        var text = consoleKey.KeyChar.ToString();
        speechSynthesizer.Speak(text);
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-09-29
    • 1970-01-01
    • 1970-01-01
    • 2014-07-02
    • 2016-09-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多