{"id":4575,"date":"2020-09-27T16:53:58","date_gmt":"2020-09-27T06:53:58","guid":{"rendered":"https:\/\/learntodroid.com\/?p=4575"},"modified":"2020-10-09T15:21:16","modified_gmt":"2020-10-09T05:21:16","slug":"how-to-use-ibms-watson-text-to-speech-service-in-an-android-app","status":"publish","type":"post","link":"http:\/\/10.0.0.14:32769\/how-to-use-ibms-watson-text-to-speech-service-in-an-android-app\/","title":{"rendered":"How to Use IBM’s Watson Text to Speech Service in an Android App"},"content":{"rendered":"\n

I was playing around with a demo I found online<\/a> that uses the Watson Text to Speech platform from IBM and I was really impressed with the quality of speech that was generated.<\/p>\n\n\n\n

Following that, I did some research on how I could integrate the Watson Text to Speech service with an Android app and I have put together a step by step guide on how to accomplish this.<\/p>\n\n\n\n

To use IBM Watson’s Text to Speech service in an Android app you will need to:<\/strong><\/p>\n\n\n\n

  1. Create an IBM Cloud Account<\/strong><\/li>
  2. Enable the Text to Speech Service and Obtain your API Key<\/strong><\/li>
  3. Add the IBM Watson SDK to your Android project with Gradle and Enable the INTERNET permission in the Manifest file<\/strong><\/li>
  4. Provide the Text and the Voice to use to the IBM Watson Text to Speech Service using the SDK<\/strong><\/li>
  5. Retrieve the Response Containing an Audio File and Save it into Internal Storage<\/strong><\/li>
  6. Play the Audio file using the Android MediaPlayer API<\/strong><\/li><\/ol>\n\n\n\n

    In this tutorial, I will walk you through each of these steps in detail and provide code samples embedded in this blog post that are also available for free on GitHub<\/a>.<\/p>\n\n\n\n

    I have also created a video of this tutorial that is available on YouTube which I have embedded below.<\/p>\n\n\n\n

    \n
    https:\/\/www.youtube.com\/watch?v=DU5Wu-5L1h4<\/a>