title: Android Text-To-Speech API Sounds Robotic
body: <p>I'm learning android development for the first time and my goal is to create a simple Hello World application that takes in some text, and reads them out loud. </p>
  
  <p>I've based my code off an example I found and here's my code:</p>
  
  <pre><code>class MainFeeds : AppCompatActivity() {
  
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main_feeds)
  
  
  
          card.setOnClickListener{
              Toast.makeText(this, "Hello", Toast.LENGTH_LONG).show()
              TTS(this, "Hello this is leo")
          }
      }
  
  }
  
  
  class TTS(private val activity: Activity,
            private val message: String) : TextToSpeech.OnInitListener {
  
            private val tts: TextToSpeech = TextToSpeech(activity, this, "com.google.android.tts")
  
      override fun onInit(i: Int) {
          if (i == TextToSpeech.SUCCESS) {
  
              val localeUS = Locale.US
  
              val result: Int
              result = tts.setLanguage(localeUS)
  
              if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {
                  Toast.makeText(activity, "This Language is not supported", Toast.LENGTH_SHORT).show()
              } else {
                  speakOut(message)
              }
  
          } else {
              Toast.makeText(activity, "Initilization Failed!", Toast.LENGTH_SHORT).show()
          }
      }
  
      private fun speakOut(message: String) {
          tts.speak(message, TextToSpeech.QUEUE_FLUSH, null, null)
      }
  }
  </code></pre>
  
  <p>And it works perfectly fine, the issue that I'm running into is that the audio that's coming out of the synthesizer sounds extremely robotic, almost like when I'm using Google Maps and I get disconnected from the internet. Is using the voice Google Assistant leverages some other API that I have to enable? </p>
  
  <p>EDIT: I've tried running the app on my pixel 2xl and it still sounds robotic, as in it's not using the Google Assistant voice. </p>