Xamarin.android 如何在xamarin中切换语言。android TextToSpeech

Xamarin.android 如何在xamarin中切换语言。android TextToSpeech,xamarin.android,Xamarin.android,如何在xamarin应用程序中在3种语言/3种语音之间切换。 我找到了很多android的样本,但没有一个是xamarin的 我试过: public void Speak(string text) { Plugin.TextToSpeech.TextToSpeech ttse = new Plugin.TextToSpeech.TextToSpeech(); CrossLocale localeen; localeen.Country = "EN"; loca

如何在xamarin应用程序中在3种语言/3种语音之间切换。 我找到了很多android的样本,但没有一个是xamarin的

我试过:

  public void Speak(string text)
  {
   Plugin.TextToSpeech.TextToSpeech ttse = new Plugin.TextToSpeech.TextToSpeech();

   CrossLocale localeen;

   localeen.Country = "EN";
   localeen.Language = "en_EN";
   ttse.Speak(text, false, localeen);
}


文本使用意大利语发音,而不是英语。

首先,您需要使用getAvailableLanguages。然后在此集合中找到所需的,并直接使用它们设置语言。或者试试这个答案中的建议。我的错误是我使用了plugin.texttospeech而不是android.texttospeech。现在效果很好!