0

我对 C# 编程很陌生,但我正在尝试将纯文本转换为语音表示。我使用PhonemeReached 事件转换纯文本并通过e.Phoneme 调用它们。(见下面的代码)。

//Initialize Synthesizer for TTS and extracting Phonemes 
SpeechSynthesizer synth = new SpeechSynthesizer(); 

//Calling the PhonemeReachedEvent
synth.PhonemeReached += new EventHandler <PhonemeReachedEventArgs>(synth_PhonemeReached);

//Speaking the text from richTextBox1 
synth.SpeakAsync(richTextBox1.Text); 

//The Event 
private void synth_PhonemeReached(object sender, PhonemeReachedEventArgs e) 
  { 
    string output = e.Phoneme; 

    //Writing the Phoneme to the richTextBox2
    richTextBox2.AppendText(string.Format(output)); 
  }

我在富文本框中返回 e.Phoneme 的结果,但它只写乱码(见下图)。这感觉像是一个编码问题,我想知道你对如何解决这个问题的看法。

http://imgur.com/KFN4E5T

更新:正如评论中所说,Jalkar 设法在 win7 上工作。当我在 Windows 7 上测试我的应用程序时,我实际上得到了一个类似音素的字符串。但是,当解码为 ASCII 时,它表示乱码。(到目前为止,我还无法掌握如何将其转换为通用电话机)。其次,正如 Hans Passant 所说,屏幕截图中乱码的 ASCII 是 American Phone 集的索引(参见他的链接)。然而,奇怪的是,Win7 和 Win8 都提供了完全不同的结果。

在下面的屏幕截图中,Win7 上的结果:http: //imgur.com/aTxf5OE

在此屏幕截图中,Win8 上的结果:imgur.com/crAR5HV

如果有人知道如何在 c# 中使用 Microsoft 的 IPA 到 UPS,我很想听听。

4

0 回答 0