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
Install Android Studio .
Include
mavenCentral()
repository in the top-levelbuild.gradle
. Then add the following to the app'sbuild.gradle
:
- Add the following to the app's
AndroidManifest.xml
file to enable recording with an Android device's microphone:
Usage
Use the PorcupineManager Builder
to create an instance of PorcupineManager
that detects the included built-in wake words porcupine
and bumblebee
:
Start audio capture and wake word detection with:
Stop with:
Free resources used by PorcupineManager
:
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):
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 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:
Demo
For the Porcupine 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 repository from GitHub using HTTPS:
Usage
- Open the Android Activity demo using Android Studio.
- Copy your
AccessKey
from Picovoice Console into theACCESS_KEY
variable in MainActivity.java . - Run the application using a connected Android device or using an Android simulator.
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, head over to our Github repository .
Resources
Package
API
GitHub
Benchmark
Further Reading