# Porcupine Wake Word Engine
Made in Vancouver, Canada by [Picovoice](https://picovoice.ai)
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:
- Arm Cortex-M, STM32, Arduino, and i.MX RT
- Raspberry Pi (Zero, 3, 4, 5)
- Android and iOS
- Chrome, Safari, Firefox, and Edge
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64)
- 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](https://console.picovoice.ai/).
## Compatibility
- Python 3.8+
- Runs on Linux (x86_64), macOS (x86_64 and arm64), Windows (x86_64, arm64), and Raspberry Pi (Zero, 3, 4, 5).
## Installation
```console
pip3 install pvporcupine
```
## 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](https://console.picovoice.ai/) to get your `AccessKey`.
## Usage
Create an instance of the engine
```python
import pvporcupine
access_key = "${ACCESS_KEY}" # AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)
handle = pvporcupine.create(access_key=access_key, 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
```python
import pvporcupine
print(pvporcupine.KEYWORDS)
```
Porcupine can detect multiple keywords concurrently
```python
import pvporcupine
access_key = "${ACCESS_KEY}" # AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)
handle = pvporcupine.create(access_key=access_key, keywords=['bumblebee', 'picovoice'])
```
To detect non-default keywords use `keyword_paths` input argument instead
```python
import pvporcupine
access_key = "${ACCESS_KEY}" # AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)
keyword_paths = ['/absolute/path/to/keyword/one', '/absolute/path/to/keyword/two', ...]
handle = pvporcupine.create(access_key=access_key, keyword_paths=keyword_paths)
```
The sensitivity of the engine can be tuned per keyword using the `sensitivities` input argument
```python
import pvporcupine
access_key = "${ACCESS_KEY}" # AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)
handle = pvporcupine.create(
access_key=access_key,
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.
```python
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
```python
handle.delete()
```
## Non-English Wake Words
In order to detect non-English wake words you need to use the corresponding model file. The model files for all supported languages are available [here](https://github.com/Picovoice/porcupine/tree/master/lib/common).
## Demos
[pvporcupinedemo](https://pypi.org/project/pvporcupinedemo/) provides command-line utilities for processing real-time
audio (i.e. microphone) and files using Porcupine.
Raw data
{
"_id": null,
"home_page": "https://github.com/Picovoice/porcupine",
"name": "pvporcupine",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "wake word engine, hotword detection, keyword spotting, wake word detection, voice commands",
"author": "Picovoice",
"author_email": "hello@picovoice.ai",
"download_url": "https://files.pythonhosted.org/packages/f8/ac/14c64255c08db0b80315ccc940943fad5fea03f0006b09b45f0b83ced08d/pvporcupine-3.0.5.tar.gz",
"platform": null,
"description": "# Porcupine Wake Word Engine\n\nMade in Vancouver, Canada by [Picovoice](https://picovoice.ai)\n\nPorcupine is a highly-accurate and lightweight wake word engine. It enables building always-listening voice-enabled\napplications. It is\n\n- using deep neural networks trained in real-world environments.\n- compact and computationally-efficient. It is perfect for IoT.\n- cross-platform:\n - Arm Cortex-M, STM32, Arduino, and i.MX RT \n - Raspberry Pi (Zero, 3, 4, 5)\n - Android and iOS\n - Chrome, Safari, Firefox, and Edge\n - Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64)\n- scalable. It can detect multiple always-listening voice commands with no added runtime footprint.\n- self-service. Developers can train custom wake word models using [Picovoice Console](https://console.picovoice.ai/).\n\n## Compatibility\n\n- Python 3.8+\n- Runs on Linux (x86_64), macOS (x86_64 and arm64), Windows (x86_64, arm64), and Raspberry Pi (Zero, 3, 4, 5).\n\n## Installation\n\n```console\npip3 install pvporcupine\n```\n\n## AccessKey\n\nPorcupine requires a valid Picovoice `AccessKey` at initialization. `AccessKey` acts as your credentials when using Porcupine SDKs.\nYou can get your `AccessKey` for free. Make sure to keep your `AccessKey` secret.\nSignup or Login to [Picovoice Console](https://console.picovoice.ai/) to get your `AccessKey`.\n\n## Usage\n\nCreate an instance of the engine\n\n```python\nimport pvporcupine\n\naccess_key = \"${ACCESS_KEY}\" # AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)\n\nhandle = pvporcupine.create(access_key=access_key, keywords=['picovoice'])\n```\n\n`handle` is an instance of Porcupine that detects utterances of \"Picovoice\". `keywords` input argument is a shorthand\nfor accessing default keyword model files shipped with the package. The list of default keywords can be retrieved by\n\n```python\nimport pvporcupine\n\nprint(pvporcupine.KEYWORDS)\n```\n\nPorcupine can detect multiple keywords concurrently\n\n```python\nimport pvporcupine\n\naccess_key = \"${ACCESS_KEY}\" # AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)\n\nhandle = pvporcupine.create(access_key=access_key, keywords=['bumblebee', 'picovoice'])\n```\n\nTo detect non-default keywords use `keyword_paths` input argument instead\n\n```python\nimport pvporcupine\n\naccess_key = \"${ACCESS_KEY}\" # AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)\nkeyword_paths = ['/absolute/path/to/keyword/one', '/absolute/path/to/keyword/two', ...]\n\nhandle = pvporcupine.create(access_key=access_key, keyword_paths=keyword_paths)\n```\n\nThe sensitivity of the engine can be tuned per keyword using the `sensitivities` input argument\n\n```python\nimport pvporcupine\n\naccess_key = \"${ACCESS_KEY}\" # AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)\n\nhandle = pvporcupine.create(\n access_key=access_key,\n keywords=['grapefruit', 'porcupine'],\n sensitivities=[0.6, 0.35])\n```\n\nSensitivity is the parameter that enables trading miss rate for the false alarm rate. It is a floating point number within\n`[0, 1]`. A higher sensitivity reduces the miss rate at the cost of increased false alarm rate.\n\nWhen initialized, the valid sample rate is given by `handle.sample_rate`. Expected frame length (number of audio samples\nin an input array) is `handle.frame_length`. The engine accepts 16-bit linearly-encoded PCM and operates on\nsingle-channel audio.\n\n```python\ndef get_next_audio_frame():\n pass\n\nwhile True:\n keyword_index = handle.process(get_next_audio_frame())\n if keyword_index >= 0:\n # detection event logic/callback\n pass\n```\n\nWhen done resources have to be released explicitly\n\n```python\nhandle.delete()\n```\n\n## Non-English Wake Words\n\nIn order to detect non-English wake words you need to use the corresponding model file. The model files for all supported languages are available [here](https://github.com/Picovoice/porcupine/tree/master/lib/common).\n\n## Demos\n\n[pvporcupinedemo](https://pypi.org/project/pvporcupinedemo/) provides command-line utilities for processing real-time\naudio (i.e. microphone) and files using Porcupine.\n",
"bugtrack_url": null,
"license": null,
"summary": "Porcupine wake word engine.",
"version": "3.0.5",
"project_urls": {
"Homepage": "https://github.com/Picovoice/porcupine"
},
"split_keywords": [
"wake word engine",
" hotword detection",
" keyword spotting",
" wake word detection",
" voice commands"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c49e4716d4737a4a6a3de306c97f3cd6040e66ef23ad8b6b8fca80190dbcc3ad",
"md5": "add1dc3f9cb68eebedc1c95083eac3d1",
"sha256": "b80b31a38b1a622e492e19683f60efdcddd1662204830fcad50df90f01723356"
},
"downloads": -1,
"filename": "pvporcupine-3.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "add1dc3f9cb68eebedc1c95083eac3d1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 2544202,
"upload_time": "2025-02-05T18:37:30",
"upload_time_iso_8601": "2025-02-05T18:37:30.898322Z",
"url": "https://files.pythonhosted.org/packages/c4/9e/4716d4737a4a6a3de306c97f3cd6040e66ef23ad8b6b8fca80190dbcc3ad/pvporcupine-3.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f8ac14c64255c08db0b80315ccc940943fad5fea03f0006b09b45f0b83ced08d",
"md5": "2ba4e56ebe876980b90028d75f858f24",
"sha256": "48f92ab10a904b811e69afb18175d2bd4857ccec8be094f42449961a80fa2af1"
},
"downloads": -1,
"filename": "pvporcupine-3.0.5.tar.gz",
"has_sig": false,
"md5_digest": "2ba4e56ebe876980b90028d75f858f24",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 2535302,
"upload_time": "2025-02-05T18:37:33",
"upload_time_iso_8601": "2025-02-05T18:37:33.808984Z",
"url": "https://files.pythonhosted.org/packages/f8/ac/14c64255c08db0b80315ccc940943fad5fea03f0006b09b45f0b83ced08d/pvporcupine-3.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-05 18:37:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Picovoice",
"github_project": "porcupine",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pvporcupine"
}