The steps for this recipe are as follows:
- In Android Studio, create a new project using Java:
- In the Gradle scripts section, change the Gradle Voice Projects folder and add the reference to the library:
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url 'https://csspeechstorage.blob.core.windows.net/maven/'
}
}
}
- In the Gradle scripts section, in the Gradle build app section, add this line to the dependencies section:
implementation 'com.microsoft.cognitiveservices.speech:client-sdk:1.10.0'
- Import the libraries needed for this project:
import androidx.appcompat.app.AppCompatActivity;
import com.microsoft.cognitiveservices.speech.KeywordRecognitionModel;
import com.microsoft.cognitiveservices.speech.SpeechConfig;
import com.microsoft.cognitiveservices.speech.SpeechRecognizer;
import com.microsoft.cognitiveservices.speech.audio.AudioConfig;
import java.io.IOException;
import...