The Client Library

The Speech To Text client library is a client library for Microsoft Bing Speech, Speech-to-text API.

The easiest way to consume the client library is to add the com.microsoft.projectoxford:speechrecognition package from Maven Central Repository. To find the latest version of client library, go to http://search.maven.org, and search for "g:com.microsoft.projectoxford".

To add the client library dependency from build.gradle file, add the following line in dependencies.

dependencies {
//
// Use the following line to include client library from Maven Central Repository
// Change the version number from the search.maven.org result
//
compile 'com.microsoft.projectoxford:speechrecognition:1.2.2'
// Your other Dependencies...
}

The Sample

This sample demonstrates the following features using a wav file or external microphone input:

Short-form recognition

Long-form dictation

Recognition with intent

Requirements

Android OS must be Android 4.1 or higher (API Level 16 or higher)

The speech client library contains native code. To use this sample in an emulator, make sure that your build variant matches the architecture (x86 or arm) of your emulator. However, due to the need of audio, using a physical device is recommended.

In Android Studio -> "Project" panel -> "Android" view, open file "SpeechRecoExample/res/values/strings.xml", and find the line "Please_add_the_subscription_key_here;". Replace the "Please_add_the_subscription_key_here" value with your subscription key string from the first step. If you cannot find the file "strings.xml", it is in folder "Samples_SpeechRecoExample_res_values_strings.xml".

In Android Studio, select menu "Build > Make Project" to build the sample, and "Run" to launch this sample app.

Running the sample

In the application, press the button "Select Mode" to select what type of Speech would like to use.

For modes where you would like both Speech recognition and Intent to work, you need to sign up Language Understanding Intelligent Service (LUIS) and set the key values in luisAppID and luisSubscriptionID from "Samples_SpeechRecoExample_res_values_strings.xml".

To Start recognition, press the Start button.

Contributing

We welcome contributions. Feel free to file issues and pull requests on the repo and we'll address them as we can. Learn more about how you can help on our Contribution Rules & Guidelines.

You can reach out to us anytime with questions and suggestions using our communities below: