androidLeopard - Android Quick Start


  • Android (4.4+)


Picovoice Account & AccessKey

Signup or Login to Picovoice Console to get your AccessKey. Make sure to keep your AccessKey secret.

Quick Start


  1. Install Android Studio.

  2. Include mavenCentral() repository in the top-level build.gradle. Then add the following to the app's build.gradle:

dependencies {
// ...
implementation 'ai.picovoice:leopard-android:${LATEST_VERSION}' // replace with latest version
  1. Add the following to the app's AndroidManifest.xml file to enable recording with an Android device's microphone:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

Adding Leopard Models

Add the Leopard model file to your Android application by:

  1. Create a custom model using the Picovoice Console or use the default model.
  2. Add the model as a bundled resource by placing it under the ${ANDROID_APP}/src/main/assets directory of your Android application.


Use the Leopard Builder to create an instance of Leopard using a model from Picovoice console or using the default model.

import ai.picovoice.leopard.*;
final String accessKey = "..."; // AccessKey provided by Picovoice Console (
final String modelPath = "${MODEL_FILE}";
try {
Leopard leopard = new Leopard.Builder()
} catch (LeopardException ex) { }

Transcribe an audio file either by in an absolute path to the file:

File audioFile = new File("${AUDIO_FILE_PATH}");
String transcript = leopard.processFile(audioFile.getAbsolutePath());

Transcribe raw audio data (sample rate of 16 kHz, 16-bit linearly encoded and 1 channel):

short[] getAudioData() {...}
String transcript = leopard.process(getAudioData());

Free resources used by Leopard:



For the Leopard Android SDK, we offer demo applications that demonstrate how to use the Speech-to-Text engine on audio recordings.


Clone the Leopard repository from GitHub using HTTPS:

git clone --recurse-submodules


  1. Open the Android demo using Android Studio.
  2. Copy your AccessKey from Picovoice Console into the ACCESS_KEY variable in
  3. Run the application using a connected Android device or using an Android simulator.






Issue with this doc? Please let us know.