Skip to main content

Porcupine Wake Word Engine Demos

Made in Vancouver, Canada by Picovoice

This package contains demos and commandline utilities for processing real-time audio (i.e. microphone) and audio files using Porcupine wake word engine.

Porcupine

Porcupine is a highly-accurate and lightweight wake word engine. It enables building always-listening voice-enabled applications. It is

  • using deep neural networks trained in real-world environments.
  • compact and computationally-efficient making it perfect for IoT.
  • scalable. It can detect multiple always-listening voice commands with no added CPU/memory footprint.
  • self-service. Developers can train custom wake phrases using Picovoice Console.

Compatibility

  • Python 3.9+
  • Runs on Linux (x86_64), Mac (x86_64 and arm64), Windows (x86_64, arm64), and Raspberry Pi (Zero, 3, 4, 5).

Installation

sudo pip3 install pvporcupinedemo

AccessKey

Porcupine requires a valid Picovoice AccessKey at initialization. AccessKey acts as your credentials when using Porcupine SDKs. You can get your AccessKey for free. Make sure to keep your AccessKey secret. Signup or Login to Picovoice Console to get your AccessKey.

Usage

Microphone Demo

It opens an audio stream from a microphone and detects utterances of a given wake word. The following opens the default microphone and detects occurrences of "Picovoice".

porcupine_demo_mic --access_key ${ACCESS_KEY} --keywords picovoice

keywords is a shorthand for using default keyword files shipped with the package. The list of default keyword files can be seen in the usage string

porcupine_demo_mic --help

To detect multiple phrases concurrently provide them as separate arguments

porcupine_demo_mic --access_key ${ACCESS_KEY} --keywords picovoice porcupine

To detect non-default keywords (e.g. models created using Picovoice Console) use keyword_paths argument

porcupine_demo_mic --access_key ${ACCESS_KEY} --keyword_paths ${KEYWORD_PATH_ONE} ${KEYWORD_PATH_TWO}

To detect non-English keywords provide the respective model path:

porcupine_demo_mic --access_key ${ACCESS_KEY} --model_path ${NON_ENGLISH_MODEL_PATH} --keyword_paths ${NON_ENGLISH_KEYWORD_PATH}

The model files for all supported languages are available here on Porcupine's GitHub repository.

It is possible that the default audio input device recognized by the demo is not the one being used. There are a couple of debugging facilities baked into the demo application to solve this. First, type the following into the console:

porcupine_demo_mic --show_audio_devices

It provides information about various audio input devices on the box. On a Linux box, this is the console output

index: 0, device name: USB Audio Device
index: 1, device name: MacBook Air Microphone

You can use the device index to specify which microphone to use for the demo. For instance, if you want to use the USB Audio Device in the above example, you can invoke the demo application as below:

porcupine_demo_mic --access_key ${ACCESS_KEY} --keywords picovoice --audio_device_index 0

If the problem persists we suggest storing the recorded audio into a file for inspection. This can be achieved by

porcupine_demo_mic --access_key ${ACCESS_KEY} --keywords picovoice --audio_device_index 0 --output_path ~/test.wav

If after listening to stored file there is no apparent problem detected please open an issue.

File Demo

It allows testing Porcupine on a corpus of audio files. The demo is mainly useful for quantitative performance benchmarking. It accepts 16kHz audio files. Porcupine processes a single-channel audio stream if a stereo file is provided it only processes the first (left) channel. The following processes a file looking for instances of the phrase "Picovoice"

porcupine_demo_file --access_key ${ACCESS_KEY} --wav_path ${AUDIO_PATH} --keywords picovoice

keywords is a shorthand for using default keyword files shipped with the package. The list of default keyword files can be seen in the usage string

porcupine_demo_file --help

To detect multiple phrases concurrently provide them as separate arguments

porcupine_demo_file --access_key ${ACCESS_KEY} --wav_path ${AUDIO_PATH} --keywords grasshopper porcupine

To detect non-default keywords (e.g. models created using Picovoice Console) use keyword_paths argument

porcupine_demo_file --access_key ${ACCESS_KEY} \
--wav_path ${AUDIO_PATH} \
--keyword_paths ${KEYWORD_PATH_ONE} ${KEYWORD_PATH_TWO}

To detect non-English keywords provide the respective model path:

porcupine_demo_mic --access_key ${ACCESS_KEY} \
--wav_path ${AUDIO_PATH} \
--model_path ${NON_ENGLISH_MODEL_PATH} \
--keyword_paths ${NON_ENGLISH_KEYWORD_PATH} 

The model files for all supported languages are available here on Porcupine's GitHub repository.

The sensitivity of the engine can be tuned per keyword using the sensitivities input argument

porcupine_demo_file --access_key ${ACCESS_KEY} \
--wav_path ${AUDIO_PATH} \
--keywords grasshopper porcupine --sensitivities 0.3 0.6

Sensitivity is the parameter that enables trading miss rate for the false alarm rate. It is a floating point number within [0, 1]. A higher sensitivity reduces the miss rate at the cost of increased false alarm rate.

Release files for pvporcupinedemo 4.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pvporcupinedemo 4.0.1
File Size Uploaded
pvporcupinedemo-4.0.1.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pvporcupinedemo 4.0.1
File Interpreter ABI Platform
pvporcupinedemo-4.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.2 kB

Release files / pvporcupinedemo-4.0.1.tar.gz

Download URL pvporcupinedemo-4.0.1.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a0b5b5ab19c5d8042092fe92c1b7b05ac4592867308759f9c977b2f8b6df24a8
BLAKE2b-256 checksum
How to use checksums
7ee9fcd6ea4b51b90d1655e98759cf1eec9053f90d7f1621a26b8c8466ed9a2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / pvporcupinedemo-4.0.1-py3-none-any.whl

Download URL pvporcupinedemo-4.0.1-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a329bc0a516e5aadaf1a0e1814463ea4bd0cf57e34aa0e4f84a6da9bef18abfe
BLAKE2b-256 checksum
How to use checksums
c1fbf9b587f1b98c3831010d662a58edee948a4fe83c4b97857a40876e384c17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

4.0.1 This release

2 release files

3.0.5

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.6

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.9.7

2 release files

1.9.6

2 release files

1.9.5

2 release files

1.9.4

2 release files

1.9.3

2 release files

1.9.1

2 release files

1.9.0

2 release files

1.8.7

2 release files

1.8.6

2 release files

1.8.5

2 release files

1.8.4

2 release files

1.8.3

2 release files

1.8.2

2 release files

1.8.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page