Microsoft.Speech.Synthesis не работает для Text To Speech, НО System.Speech.Synthesis работает. Почему?
Я просто пытаюсь запустить простой пример Microsoft для Text To Speech, используяMicrosoft.Speech.dll;
using System;
using Microsoft.Speech.Synthesis;
namespace TTS
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Testing TTS!");
// Initialize a new instance of the SpeechSynthesizer.
using (SpeechSynthesizer synth = new SpeechSynthesizer())
{
// Output information about all of the installed voices.
Console.WriteLine("Installed voices -");
foreach (InstalledVoice voice in synth.GetInstalledVoices())
{
VoiceInfo info = voice.VoiceInfo;
Console.WriteLine(" Voice Name: " + info.Name);
}
// Select the US English voice.
synth.SelectVoice("Microsoft Server Speech Text to Speech Voice (en-GB, Hazel)");
// Build a prompt.
PromptBuilder builder = new PromptBuilder();
builder.AppendText("That is a big pizza!");
// Speak the prompt.
synth.Speak(builder);
}
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
}
}
Хотя у меня есть правильные голоса,он не издает никаких звуков, Нет текста в речь (TTS) голос.
Когда я использую MicrosoftSystem.Speech.dll тогдаЯ слышу голос, Так что проблем со звуком нет.
using System;
using System.Speech.Synthesis;
namespace TTS
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Testing TTS!");
// Initialize a new instance of the SpeechSynthesizer.
using (SpeechSynthesizer synth = new SpeechSynthesizer())
{
// Output information about all of the installed voices.
Console.WriteLine("Installed voices -");
foreach (InstalledVoice voice in synth.GetInstalledVoices())
{
VoiceInfo info = voice.VoiceInfo;
Console.WriteLine(" Voice Name: " + info.Name);
}
// Build a prompt.
PromptBuilder builder = new PromptBuilder();
builder.AppendText("That is a big pizza!");
// Speak the prompt.
synth.Speak(builder);
}
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
}
}
вскоре
Почему я не могу слышать голос или делать текст в речь (TTS) с Microsoft Speech Platform, используя Microsoft.Speech? Должен ли я сделать некоторые дополнительные настройки?