4

我正在用 C# 为 Windows 8 做一个应用程序。在那个应用程序中,我有一个文本转语音部分。我目前正在使用 bing 翻译器 api,但我发现 Google TTS api 非常有效。我正在使用此代码

<MediaElement x:Name="medEle" AudioCategory="BackgroundCapableMedia"  Height="100" Width="100"/>

private void speakword(object sender, RoutedEventArgs e)
{
   prgrsRing_Copy.IsActive = true;

   string path = "http://translate.google.com/translate_tts?tl=en&q=Windows";
   medEle.Source = new Uri(path,UriKind.RelativeOrAbsolute);
   medEle.Play();
  prgrsRing_Copy.IsActive = false;
}

但这不起作用。请帮助我做到这一点。

4

0 回答 0