Rhino Speech-to-Intent
Android Quick Start
Platforms
- Android (5.0+)
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 RhinoManager Builder
to create an instance of RhinoManager
:
Start audio capture and the Speech-to-Intent engine:
Once an inference has been made, the RhinoManagerCallback
will be invoked and audio capture will stop automatically.
Free resources used by RhinoManager
:
Custom Contexts
Create custom contexts using the Picovoice Console. Download the custom context file (.rhn
) and add it to the ${ANDROID_APP}/src/main/assets
directory of your Android project. Create an instance of RhinoManager
using the .setContextPath
builder method and the context file path (relative to the assets
directory).
Alternatively, if the context file is deployed to the device with a different method, the absolute path to the file on device can be used.
Non-English Languages
Use the corresponding model file (.pv
) to detect non-English contexts.
The model files for all supported languages are available
on the Rhino Speech-to-Intent GitHub repository.
Pass in the model path (relative to the assets
directory) using the setModelPath
builder method to change the inference language:
Alternatively, if the model file is deployed to the device with a different method, the absolute path to the file on device can be used.
Demo
For the Rhino Speech-to-Intent Android SDK, we offer demo applications that demonstrate how to use the Speech-to-Intent engine on real-time audio streams (i.e. microphone input).
Setup
Clone the Rhino Speech-to-Intent repository from GitHub using HTTPS:
Usage
- Open the Android Activity demo using Android Studio.
- Go to
Build > Select Build Variant...
and select the language you would like to run the demo in (e.g. enDebug -> English, itRelease -> Italian) - 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.