# Porcupine

> On-device wake-word detection, from microcontrollers to the browser

- Category: Multimodal Generation / Audio, Music & Voice
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/Picovoice/porcupine
- Website: https://picovoice.ai/
- Canonical page: https://ai-tldr.dev/tools/porcupine/

## In short

Porcupine is a wake word engine from Picovoice for building always-listening, voice-enabled applications. It solves one narrowly scoped problem well: detecting one or a few static trigger phrases — the "Hey Siri" moment — so your application knows when to start paying attention. It sits in the Audio, Music & Voice category of the Multimodal Generation tools and is open-source, written in Python and licensed Apache-2.0.

## Overview

Porcupine is a wake word engine from Picovoice for building always-listening, voice-enabled applications. It solves one narrowly scoped problem well: detecting one or a few static trigger phrases — the "Hey Siri" moment — so your application knows when to start paying attention. The models are trained on real-world audio and the engine is described as compact and computationally efficient, which is what makes it viable on an IoT device rather than only on a workstation.

Its defining property is that detection happens entirely on-device. Nothing is streamed to a server to decide whether the trigger phrase was spoken, which matters both for privacy and for latency. The engine is also scalable in an unusual sense: it can listen for multiple wake words at once with no added runtime footprint, so a device can respond to several distinct commands without running several detectors.

Porcupine is deliberately not a general speech-recognition system. Picovoice points you at its own Rhino Speech-to-Intent engine when you need to understand complex, naturally spoken commands within a domain, and at the broader Picovoice platform when you want an Alexa-style end-to-end voice experience. The repository code is Apache-2.0, but the SDKs authenticate with an AccessKey obtained from Picovoice Console, which is also where you train custom wake word models.

## What it does

- Runs fully on-device — no audio leaves the machine for the wake-word decision
- Cross-platform by design: Arm Cortex-M, STM32 and Arduino, Raspberry Pi, Android and iOS, the major browsers, and Linux, macOS and Windows
- SDKs for Python, .NET, Java, C, Node.js, Flutter, React Native and the web, published to the usual package registries
- Detects multiple always-listening commands at once with no added runtime footprint
- Ships a set of default keyword models, listable at runtime, plus custom wake words trained self-service in Picovoice Console
- Nine supported languages including English, Mandarin, French, German, Italian, Japanese, Korean, Portuguese and Spanish

## Getting started

Every SDK follows the same shape: install the package for your platform, supply an AccessKey from Picovoice Console, then create an engine instance for the keywords you want to listen for. The Python SDK is the shortest path to a first run.

1. Install the Python SDK

   The Python binding is published to PyPI as `pvporcupine`.

```bash
pip3 install pvporcupine
```

2. Create an engine instance

   The SDK exposes a factory method. The AccessKey comes from Picovoice Console; `keywords` is shorthand for the default keyword files shipped with the library.

```python
import pvporcupine

# AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)
access_key = "${ACCESS_KEY}"

handle = pvporcupine.create(access_key=access_key, keywords=['picovoice', 'bumblebee'])
```

3. See which default keywords are available

   The library exposes the list of bundled keyword files at runtime, so you do not have to guess the spelling of a built-in trigger phrase.

```python
import pvporcupine

print(pvporcupine.KEYWORDS)
```

4. Try a demo, then pick your platform

   A runnable demo package is published separately, and the repository carries per-platform demos and SDK instructions for .NET, Java, Flutter, React Native, Android, iOS, web, Node.js, C and microcontrollers. For a non-default trigger phrase, train a custom keyword in Picovoice Console and pass its file path instead of the `keywords` shorthand.

```bash
sudo pip3 install pvporcupinedemo
```

## When to use it

- Add a hands-free trigger phrase to a mobile or desktop app so it starts listening without a tap
- Run always-listening voice activation on a Raspberry Pi or a Cortex-M microcontroller where a cloud round trip is not an option
- Give a browser-based assistant a wake word without streaming continuous microphone audio to a server
- Listen for several distinct spoken commands on one device without paying for several detectors
