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
Flutter Quick Start

Platforms

  • Flutter (2.8.1+)
  • Android (5.0+, API 21+)
  • iOS (13.0+)

Requirements

  • Flutter SDK
  • Android SDK (21+)
  • JDK (8+)
  • Xcode (13+)

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 Flutter SDK.

  2. Run flutter doctor to determine any missing requirements.

  3. Add the Porcupine Wake Word plugin to your app project by referencing it in pubspec.yaml:

dependencies:
porcupine_flutter: ^<version>
  1. Enable the proper permission for recording with the hardware's microphone on both iOS and Android:

iOS

Open your Info.plist and add the following line:

<key>NSMicrophoneUsageDescription</key>
<string>[Permission explanation]</string>

Android

Open your AndroidManifest.xml and add the following line:

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />

Usage

Create an instance of PorcupineManager using the constructor PorcupineManager.fromKeywords that detects the included built-in wake words porcupine and bumblebee:

import 'package:porcupine/porcupine_manager.dart';
import 'package:porcupine/porcupine_error.dart';
void createPorcupineManager() async {
try {
_porcupineManager = await PorcupineManager.fromBuiltInKeywords(
"{ACCESS_KEY}",
[BuiltInKeyword.PORCUPINE, BuiltInKeyword.BUMBLEBEE],
_wakeWordCallback);
} on PorcupineException catch (err) {
// handle porcupine init error
}
}

The _wakeWordCallback parameter is a function that is invoked when Porcupine Wake Word detects the wake word:

void _wakeWordCallback(int keywordIndex) {
if(keywordIndex === 0) {
// porcupine detected
}
else if (keywordIndex === 1) {
// bumblebee detected
}
}

Start audio capture and wake word detection:

try{
await _porcupineManager.start();
} on PvAudioException catch (ex) {
// deal with audio exception
}

Stop with:

await _porcupineManager.stop();

Release resources explicitly when done with Porcupine:

await _porcupineManager.delete();
To use your own audio processing pipeline, check out the Low-Level Porcupine API.

Custom Keywords

  1. Create custom keywords using the Picovoice Console.
  2. Download the custom wake word file (.ppn).
  3. Add the file to the assets folder in the project directory.
  4. Add the relative path to the pubspec.yaml:
flutter:
assets:
- assets/${KEYWORD_FILE}
  1. Use the PorcupineManager.fromKeywordPaths static constructor and provide the paths to the .ppn file(s):
String keywordAsset = "assets/${KEYWORD_FILE}"
_porcupineManager = await PorcupineManager.fromKeywordPaths(
"${ACCESS_KEY}",
["assets/${KEYWORD_FILE}"],
_wakeWordCallback);

Alternatively, if the keyword files are deployed to the device with a different method, the absolute paths to the files on device can be used.

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.

  1. Add the file to the assets folder in the project directory.
  2. Add it to the pubspec.yaml:
flutter:
assets:
- assets/${KEYWORD_FILE}
- assets/${MODEL_FILE}

Pass in the model file using the modelPath parameter to change the detection language:

_porcupineManager = await PorcupineManager.fromKeywordPaths(
"{ACCESS_KEY}",
"assets/${KEYWORD_FILE}",
_wakeWordCallback,
modelPath: "assets/${MODEL_FILE}");

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 Porcupine Wake Word Flutter 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 GitHub Repository:

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

Usage

  1. Run the prepare_demo script with a language code to set up the demo in the language of your choice (e.g. de -> German, ko -> Korean). To see a list of available languages, run prepare_demo without a language code.
cd porcupine/demo/flutter
dart scripts/prepare_demo.dart ${LANGUAGE}
  1. Replace {YOUR_ACCESS_KEY_HERE} with a valid AccessKey in the demo/flutter/lib/main.dart file:

  2. Build and deploy the demo to your device:

flutter run

For more information on our Porcupine Wake Word demos for Flutter, head over to our GitHub repository.

Resources

Package

  • porcupine_flutter on pub.dev

API

  • porcupine_flutter API Docs

GitHub

  • Porcupine Wake Word Flutter SDK on GitHub
  • Porcupine Wake Word Flutter Demos on GitHub

Benchmark

  • Wake Word Benchmark

Further Reading

  • Offline Speech Recognition in Flutter: No Siri, No Google, and No, It’s Not Speech-To-Text

Video

  • Offline Speech Recognition with Flutter (iOS/Android)

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Porcupine Wake Word Flutter 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.