我正在开发一个 C# 应用程序,需要希伯来语文本转语音 (TTS) 功能。 我最初尝试使用内置的 System.Speech.SpeechSynthesizer 库。 然而,正如预期的那样,它不提供对希伯来语声音的原生支持, 导致 GetInstalledVoices 方法找不到任何希伯来语选项。 此外,由于缺乏合适的声音,Speak 方法不会产生任何输出。
这是我的测试
class Program
{
static async Task Main()
{
// Initialize a new instance of the SpeechSynthesizer.
SpeechSynthesizer synth = new SpeechSynthesizer();
var x = synth.GetInstalledVoices(); // This won't find Hebrew voices
// Configure the audio output.
synth.SetOutputToDefaultAudioDevice();
// Speak a string (won't produce output due to missing Hebrew voice).
synth.Speak("בדיקה");
}
}