{"id":4712,"date":"2020-10-25T12:08:24","date_gmt":"2020-10-25T02:08:24","guid":{"rendered":"https:\/\/learntodroid.com\/?p=4712"},"modified":"2020-10-25T12:08:33","modified_gmt":"2020-10-25T02:08:33","slug":"how-to-use-ibms-watson-speech-to-text-service-in-an-android-app","status":"publish","type":"post","link":"http:\/\/10.0.0.14:32769\/how-to-use-ibms-watson-speech-to-text-service-in-an-android-app\/","title":{"rendered":"How to Use IBM\u2019s Watson Speech to Text Service in an Android App"},"content":{"rendered":"\n

There are a number of different speech to text APIs that exist today. I experiment with IBM’s Watson Speech to Text service to see how easy it is to integrate with an Android app and the accuracy of the transcription results.<\/p>\n\n\n\n

I have done some research and created a sample Android app that demonstrates how to integrate with IBM’s Watson Speech to Text service in Android. I have put together a step by step guide on how to accomplish this.<\/p>\n\n\n\n

To use IBM Watson’s Speech to Text 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 Speech to Text service and obtain your API Key<\/strong><\/li>
  3. Add the IBM Watson SDK to your Android project with Gradle<\/strong><\/li>
  4. Request INTERNET and RECORD_AUDIO permissions in the Manifest file<\/strong><\/li>
  5. Make a runtime request in the Activity class for access to the RECORD_AUDIO permission<\/strong><\/li>
  6. Use the MediaRecorder API to make an audio recording of your speech<\/strong><\/li>
  7. Convert audio recording to MP3 format using the FFMPEG library<\/strong><\/li>
  8. Provide the audio recording in an MP3 format to the Speech to Text API<\/strong><\/li>
  9. Retrieve the response containing the converted text and display the text in a RecyclerView<\/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=JUJCp0Nxnc0<\/a>