![]() In Android, the RECORD_AUDIO permission is considered a dangerous permission, which means you will need to make a run time request inside your Activity class to prompt the user to provide their consent to use the device’s microphone. Request Audio Recording Run Time Permission See the sample app manifest file containing the INTERNET and RECORD_AUDIO permission below. We will also need to add the RECORD_AUDIO permission as we will be using the device’s microphone to record and audio clip which we will provide to the Speech to Text service to translate it into text. In the app’s manifest file we will need to add the INTERNET permission as we will invoke the Speech to Text service over the Internet. ![]() In this section of the tutorial, we will request access to two permissions in the Android app’s manifest file. See the sample app level adle file below. In addition to this, we will a line in the defaultConfig section to enable multi dex.Īlso in order to use the mobile FFMPEG library in your Android app, you will also need to set the minSdkVersion to at least version 24. The mobile FFMPEG library is required to convert the audio recording we will make of our speech into an MP3 format that can be consumed by the Watson speech to text service. The IBM Watson SDK will be used to interact with the Watson Speech to Text service. The first for the IBM Watson SDK and the second for the mobile FFMPEG library. In the dependencies section of the app level adle file, we will add two dependencies. Once you have created a new Android project, open the app level adle file where we make some changes. In this section of the tutorial, we will create a new Android project in Android Studio, then we will retrieve the dependencies required to use IBM’s Watson Speech to Text service in our Android app using Gradle. Once the service has been created, go into the Manage section and note the API key and the base URL of the URL shown in this screen which we will copy over to our Android app in a subsequent step. When you are ready to create the service, select the “Create” button. We will want to use the Lite Plan for our Speech to Text service, which currently allows you to perform 500 minutes a month of speech to text for free. Then, you can pick the region your service will be based in. Then, search for “Speech to Text” in the service catalogue and select the “Speech to Text” result. In the IBM Cloud home screen, select the “Create resource” button in the top right section of the screen.Īfter that, go into the “Services” section. Now that you have created an IBM Cloud account, what you will need to do next is create a Speech to Text resource you can use against your account. Enabling Speech to Text and Obtaining API Key Then you will need to verify your email address using a code sent via email.Īfter that you will need to enter some personal information for your account, then you can select the “Create account” button. Navigate to the IBM Cloud account registration form in a web browser and fill out account information with an email address and password. In order to use IBM’s Watson Text to Speech service, you will need to create an IBM Cloud account. Video can’t be loaded because JavaScript is disabled: Android IBM Watson Speech to Text Tutorial () Android Watson Speech to Text Tutorial Creating an IBM Cloud Account I have also created a video of this tutorial that is available on YouTube which I have embedded below. 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. Retrieve the response containing the converted text and display the text in a RecyclerView.Provide the audio recording in an MP3 format to the Speech to Text API.Convert audio recording to MP3 format using the FFMPEG library.Use the MediaRecorder API to make an audio recording of your speech.Make a runtime request in the Activity class for access to the RECORD_AUDIO permission. ![]() ![]() Request INTERNET and RECORD_AUDIO permissions in the Manifest file.Add the IBM Watson SDK to your Android project with Gradle.Enable the Speech to Text service and obtain your API Key.To use IBM Watson’s Speech to Text service in an Android app you will need to: I have put together a step by step guide on how to accomplish this. 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 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. There are a number of different speech to text APIs that exist today. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |