Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice Cheetah
FAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryAmazon PollyAzure TTSElevenLabsOpenAI TTSPicovoice Orca
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidCNode.jsPythoniOSWeb
SummaryPicovoice EaglepyannoteSpeechBrainWeSpeaker
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice FalconAmazon TranscribeAzure Speech-to-TextGoogle Speech-to-Textpyannote
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeRustUnityWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustUnityWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiRustWebWindows
AndroidC.NETiOSNode.jsPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

Porcupine Wake Word
Android Quick Start

Platforms

  • Android (5.0+, API 21+)

Requirements

  • Picovoice Account and AccessKey
  • Android Studio
  • Android device with USB debugging enabled or Android simulator

Picovoice Account & AccessKey

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

Quick Start

Setup

  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:porcupine-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" />

Usage

Use the PorcupineManager Builder to create an instance of PorcupineManager that detects the included built-in wake words porcupine and bumblebee:

import ai.picovoice.porcupine.*;
PorcupineManagerCallback wakeWordcallback = new PorcupineManagerCallback() {
@Override
public void invoke(int keywordIndex) {
if (keywordIndex == 0) {
// porcupine detected
} else if (keywordIndex == 1) {
// bumblebee detected
}
}
};
PorcupineMananger porcupineManager = new PorcupineManager.Builder()
.setAccessKey("${ACCESS_KEY}")
.setKeywords([Porcupine.BuiltInKeyword.PORCUPINE, Porcupine.BuiltInKeyword.BUMBLEBEE])
.build(context, wakeWordCallback);

Start audio capture and wake word detection with:

porcupineManager.start();

Stop with:

porcupineManager.stop();

Free resources used by PorcupineManager:

porcupineManager.delete();
To use your own audio processing engine, check out the Low-Level API on the Picovoice GitHub repository.

Custom Keywords

Create custom keyword using the Picovoice Console. Download the custom wake word file (.ppn) and add it to the ${ANDROID_APP}/src/main/assets directory of your Android project. Create an instance of PorcupineManager using the .setKeywordPaths builder method and the keyword path (relative to the assets directory or absolute path to the file on device):

PorcupineManager porcupineManager = new PorcupineManager.Builder()
.setAccessKey("${ACCESS_KEY}")
.setKeywordPaths(["${KEYWORD_FILE_PATH}"])
.build(context, wakeWordCallback);

Non-English Languages

Use the corresponding model file (.pv), to detect non-English wake words. The model files for all supported languages are available on the Porcupine Wake Word GitHub repository.

Pass in the model path (relative to the assets directory or absolute path to the file on device) using the setModelPath builder method to change the detection language:

PorcupineManager porcupineManager = new PorcupineManager.Builder()
.setAccessKey("${ACCESS_KEY}")
.setKeywordPaths(["${KEYWORD_FILE_PATH}"])
.setModelPath("${MODEL_FILE_PATH}")
.build(context, wakeWordCallback);

Demo

For the Porcupine Wake Word Android SDK, we offer demo applications that demonstrate how to use the Wake Word engine on real-time audio streams (i.e. microphone input).

Setup

Clone the Porcupine Wake Word repository from GitHub using HTTPS:

git clone --recurse-submodules https://github.com/Picovoice/porcupine.git

Usage

  1. Open the project in Android Studio
  2. Copy your AccessKey into the ACCESS_KEY variable in MainActivity.java.
  3. Go to Build > Select Build Variant... and select the language you would like to run the demo in (e.g. enDebug -> English, itRelease -> Italian)
  4. Build and run on an installed simulator or a connected Android device

The demo detects the chosen keyword only when the application is in focus. To run the demo in the background or use in conjunction with Android's Speech-To-Text API, check out the other Android demos on our GitHub repository.

Resources

Package

  • porcupine-android on Maven Central

API

  • porcupine-android API Docs

GitHub

  • Porcupine Wake Word Android SDK on GitHub
  • Porcupine Wake Word Android demos on GitHub

Benchmark

  • Wake Word Benchmark

Further Reading

  • No Way, Google: Build Your Own Wake Word Service on Android

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Porcupine Wake Word Android Quick Start
  • Platforms
  • Requirements
  • Picovoice Account & AccessKey
  • Quick Start
  • Setup
  • Usage
  • Custom Keywords
  • Non-English Languages
  • Demo
  • Setup
  • Usage
  • Resources
Voice AI
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Orca Text-to-Speech
  • Koala Noise Suppression
  • Eagle Speaker Recognition
  • Falcon Speaker Diarization
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Local LLM
  • picoLLM Inference
  • picoLLM Compression
  • picoLLM GYM
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
  • Playground
Sales & Services
  • Consulting
  • Foundation Plan
  • Enterprise Plan
  • Enterprise Support
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • X
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2025 Picovoice Inc.