This article serves as a comprehensive guide for adding on-device Speech Recognition to an Android app.

In the world of software, there is often confusion about the exact meaning of Speech Recognition. Most assume it refers solely to Speech-to-Text features. However, Speech-to-Text represents only a single facet of Speech Recognition. Additional technologies under to umbrella of Speech Recognition include Wake Word Detection, Voice Command Recognition, and Voice Activity Detection (VAD).

Here's a handy guide for selecting an appropriate Speech Recognition approach for your Android application:

There are also SDKs available for iOS, as well as cross-platform mobile frameworks Flutter and React Native.

Cobra VAD

  1. To integrate the Cobra VAD SDK into your Android project, ensure you have included mavenCentral() in your top-level build.gradle file, then add the following dependency to your app’s build.gradle file:
  1. Sign up for a free Picovoice Console account and obtain your AccessKey. The AccessKey is only required for authentication and authorization.

  2. Add the following to the app's AndroidManifest.xml file to enable recording with an Android device's microphone.

  1. Create an instance of the VAD engine:
  1. Find the probability of voice by passing in audio frames to the .process function:

For further details, visit the Cobra VAD product page or refer to Cobra's Android SDK quick start guide.

Porcupine Wake Word

  1. To integrate the Porcupine Wake Word SDK into your Android project, ensure you have included mavenCentral() in your top-level build.gradle file, then add the following dependency to your app’s build.gradle file:
  1. Sign up for a free Picovoice Console account and obtain your AccessKey. The AccessKey is only required for authentication and authorization.

  2. Add the following to the app's AndroidManifest.xml file to enable recording with an Android device's microphone.

  1. Create a custom wake word model using Picovoice Console.

  2. Download the .ppn model file and copy it into your Android assets folder (${ANDROID_APP}/src/main/assets).

  3. Initialize the Porcupine Wake Word engine with the .ppn file name (or path relative to the assets folder):

  1. Detect the keyword by passing in audio frames to the .process function:

For further details, visit the Porcupine Wake Word product page or refer to Porcupine's Android SDK quick start guide.

Rhino Speech-to-Intent

  1. To integrate the Rhino Speech-to-Intent SDK into your Android project, ensure you have included mavenCentral() in your top-level build.gradle file, then add the following dependency to your app’s build.gradle file:
  1. Sign up for a free Picovoice Console account and obtain your AccessKey. The AccessKey is only required for authentication and authorization.

  2. Add the following to the app's AndroidManifest.xml file to enable recording with an Android device's microphone.

  1. Create a custom context model using Picovoice Console.

  2. Download the .rhn model file and copy it into your Android assets folder (${ANDROID_APP}/src/main/assets).

  3. Initialize the Rhino Speech-to-Intent engine with the .rhn file name (or path relative to the assets folder):

  1. Infer the user's intent by passing in audio frames to the .process function:

For further details, visit the Rhino Speech-to-Intent product page or refer to Rhino's Android SDK quick start guide.

Cheetah Streaming Speech-to-Text

  1. To integrate the Cheetah Streaming Speech-to-Text SDK into your Android project, ensure you have included mavenCentral() in your top-level build.gradle file, then add the following dependency to your app’s build.gradle file:
  1. Sign up for a free Picovoice Console account and obtain your AccessKey. The AccessKey is only required for authentication and authorization.

  2. Add the following to the app's AndroidManifest.xml file to enable recording with an Android device's microphone.

  1. Download the .pv language model file from the Cheetah GitHub repository and copy it into your Android assets folder (${ANDROID_APP}/src/main/assets).

  2. Initialize the Cheetah Streaming Speech-to-Text engine with the .pv file name (or path relative to the assets folder):

  1. Transcribe speech to text in real time by passing in audio frames to the .process function:

For further details, visit the Cheetah Streaming Speech-to-Text product page or refer to Cheetah's Android SDK quick start guide.

Leopard Speech-to-Text

  1. To integrate the Leopard Speech-to-Text SDK into your Android project, ensure you have included mavenCentral() in your top-level build.gradle file, then add the following dependency to your app’s build.gradle file:
  1. Sign up for a free Picovoice Console account and obtain your AccessKey. The AccessKey is only required for authentication and authorization.

  2. Add the following to the app's AndroidManifest.xml file to enable recording with an Android device's microphone.

  1. Download the .pv language model file from the Leopard GitHub repository and copy it into your Android assets folder (${ANDROID_APP}/src/main/assets).

  2. Create an instance of Leopard for speech-to-text transcription:

  1. Transcribe speech to text by passing an audio file to the .processFile function:

For further details, visit the Leopard Speech-to-Text product page or refer to Leopard's Android SDK quick start guide.