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

Platforms

  • Arm Cortex-M4

Requirement

  • C99-compatible compiler

Picovoice Account & AccessKey

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

Quick Start

Setup

  1. Clone the repository:
git clone --recurse-submodules https://github.com/Picovoice/porcupine.git

Usage

  1. Include the public header files.
  2. Link the project to an appropriate library file.
  3. Construct the porcupine object:
#define MEMORY_BUFFER_SIZE ${MEMORY_BUFFER_SIZE}
static const char* ACCESS_KEY = "${ACCESS_KEY}";
uint8_t memory_buffer[MEMORY_BUFFER_SIZE] __attribute__((aligned(16)));
const uint8_t keyword_array[] = ${KEYWORD_ARRAY};
const int32_t keyword_model_sizes = sizeof(${KEYWORD_ARRAY});
const void *keyword_models = keyword_array;
const float sensitivity = 0.5f;
pv_porcupine_t *porcupine = NULL;
const pv_status_t status = pv_porcupine_init(
ACCESS_KEY,
MEMORY_BUFFER_SIZE,
memory_buffer,
1,
&keyword_model_sizes,
&keyword_models,
&sensitivity,
&porcupine);
if (status != PV_STATUS_SUCCESS) {
// error handling logic
}
  1. Pass in frames of audio to the pv_porcupine_process function:
extern const int16_t *get_next_audio_frame(void);
while (true) {
const int16_t *pcm = get_next_audio_frame();
int32_t keyword_index;
const pv_status_t status = pv_porcupine_process(porcupine, pcm, &keyword_index);
if (status != PV_STATUS_SUCCESS) {
// error handling logic
}
if (keyword_index != -1) {
// detection event logic/callback
}
}
  1. Release resources explicitly when done with Picovoice:
pv_porcupine_delete(porcupine);

Create Custom Keywords

  1. Obtain the UUID of the chipset.
  2. Go to Picovoice Console to create models for Porcupine Wake Word engine.
  3. Select Arm Cortex-M as the platform when training the model.
  4. Select appropriate board type.
  5. Train your models.
  6. Download your custom keyword model.
  7. Decompress the zip file. The .ppn file inside is the binary model for the Porcupine Wake Word. The zip archive also contains a .h header file containing the C array version of the binary model.
  8. Copy the contents of the arrays inside the .h header files and update the keyword_array.

Non-English Languages

Use the corresponding library file (.a) to process non-English wake words. The library files for all supported languages are available on the Porcupine Wake Word GitHub repository.

Demo

For the Porcupine Wake Word mcu SDK, we offer demo projects for several evaluation boards to demonstrate how to use the Porcupine wake word engine on microcontrollers. The full list of supported boards are available on the Porcupine GitHub repository.

Setup

Clone the repository:

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

Usage

  • Arduino Nano 33 BLE Sense (Arm Cortex-M4)
  • STM32F411E-DISCO (Arm Cortex-M4)

Resources

API

  • Microcontroller API doc

GitHub

  • Porcupine Wake Word mcu Demos on GitHub

Benchmark

  • Wake Word Benchmark

Further Reading

  • Offline voice recognition on MCUs - walkthrough

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Porcupine Wake Word Microcontroller Quick Start
  • Platforms
  • Requirement
  • Picovoice Account & AccessKey
  • Quick Start
  • Setup
  • Usage
  • Create 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.