Skip to main content

Porcupine wake word engine.

Project description

Porcupine Wake Word Engine

Made in Vancouver, Canada by Picovoice

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. It is perfect for IoT.
  • cross-platform. Raspberry Pi, BeagleBone, Android, iOS, Linux (x86_64), macOS (x86_64), Windows (x86_64), and web browsers are supported. Additionally, enterprise customers have access to ARM Cortex-M SDK.
  • scalable. It can detect multiple always-listening voice commands with no added runtime footprint.
  • self-service. Developers can train custom wake word models using Picovoice Console.

Compatibility

  • Python 3
  • Runs on Linux (x86_64), macOS (x86_64), Windows (x86_64), Raspberry Pi, and BeagleBone.

Installation

pip3 install pvporcupine

Usage

Create an instance of the engine

import pvporcupine

handle = pvporcupine.create(keywords=['picovoice'])

handle is an instance of Porcupine that detects utterances of "Picovoice". keywords input argument is a shorthand for accessing default keyword model files shipped with the package. The list of default keywords can be retrieved by

import pvporcupine

print(pvporcupine.KEYWORDS)

Porcupine can detect multiple keywords concurrently

import pvporcupine

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

To detect non-default keywords use keyword_paths input argument instead

import pvporcupine

keyword_paths = ['/absolute/path/to/keyword/one', '/absolute/path/to/keyword/two', ...]

handle = pvporcupine.create(keyword_paths=keyword_paths)

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

import pvporcupine

handle = pvporcupine.create(
        keywords=['grapefruit', 'porcupine'],
        sensitivities=[0.6, 0.35])

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.

When initialized, the valid sample rate is given by handle.sample_rate. Expected frame length (number of audio samples in an input array) is handle.frame_length. The engine accepts 16-bit linearly-encoded PCM and operates on single-channel audio.

def get_next_audio_frame():
    pass

while True:
    keyword_index = handle.process(get_next_audio_frame())
    if keyword_index >= 0:
        # detection event logic/callback
        pass

When done resources have to be released explicitly

handle.delete()

Demos

pvporcupinedemo provides command-line utilities for processing real-time audio (i.e. microphone) and files using Porcupine.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pvporcupine-1.9.1.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pvporcupine-1.9.1-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file pvporcupine-1.9.1.tar.gz.

File metadata

  • Download URL: pvporcupine-1.9.1.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for pvporcupine-1.9.1.tar.gz
Algorithm Hash digest
SHA256 ea677b210c08c8711328d798ec8271867d662abf9bed402df0b18cb87826cdf6
MD5 6de82cbb379c2466e12d77983bb10a5b
BLAKE2b-256 234ca0439227507ae4470e1df2f52c74baed4d4a69062ce1b75f59e1dd3d434b

See more details on using hashes here.

File details

Details for the file pvporcupine-1.9.1-py3-none-any.whl.

File metadata

  • Download URL: pvporcupine-1.9.1-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for pvporcupine-1.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa8a25efa5d4eef8c19e74a2506947ae39f4b2068ef4fe1831627ceaba3264a8
MD5 0eef72f5a633bcdf225aaefb4b4997a7
BLAKE2b-256 4dc39a85c65e57e6f7457194582f45a608c35db59c6e86c617700398eff483c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page