On-Device wake word detection powered by deep learning.
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 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
- Runs on Linux (x86_64), Mac (x86_64), Windows (x86_64), Raspberry Pi (all variants), and Beagle Bone.
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 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 use non-default keyword files use keyword_file_paths
input argument instead
import pvporcupine
handle = pvporcupine.create(keyword_file_paths=['/absolute/path/to/keyword/one', '/absolute/path/to/keyword/two', ...])
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 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.
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. The source code for these utilities is available on Porcupine's GitHub repository:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pvporcupine-1.8.4.tar.gz
.
File metadata
- Download URL: pvporcupine-1.8.4.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 448350bb2a8c4008bdf1b7e1f430dd9fe1266d22ffe9cc6efd4a18b2c02f00e3 |
|
MD5 | 624fa044aaa0936388dcf76cdbab8242 |
|
BLAKE2b-256 | 9436f5b9957066126e6dbf8ff95034da897bccb044f75286dc3699b46eb82492 |
File details
Details for the file pvporcupine-1.8.4-py3-none-any.whl
.
File metadata
- Download URL: pvporcupine-1.8.4-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 759af4787dc907cdc985e16678e33c7ed34bd0e3cbc8687b299bb230cc313571 |
|
MD5 | 636366b6a4ef2873caa033005130ae46 |
|
BLAKE2b-256 | 1c948e6b04e76b8c537430f7f618e5ee528709118c9e526562b44084fdeb3468 |