Picovoice is an end-to-end platform for building voice products on your terms.
Project description
Picovoice
Made in Vancouver, Canada by Picovoice
Picovoice is an end-to-end platform for building voice products on your terms. It enables creating voice experiences similar to Alexa and Google. But it entirely runs 100% on-device. Picovoice is
- Private: Everything is processed offline. Intrinsically HIPAA and GDPR compliant.
- Reliable: Runs without needing constant connectivity.
- Zero Latency: Edge-first architecture eliminates unpredictable network delay.
- Accurate: Resilient to noise and reverberation. It outperforms cloud-based alternatives by wide margins *.
- Cross-Platform: Design once, deploy anywhere. Build using familiar languages and frameworks.
Compatibility
- Python 3
- Runs on Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64), Raspberry Pi (all variants), NVIDIA Jetson (Nano), and BeagleBone.
Installation
pip3 install picovoice
AccessKey
Picovoice requires a valid AccessKey
at initialization. AccessKey
s act as your credentials when using Picovoice SDKs.
You can create your AccessKey
for free. Make sure to keep your AccessKey
secret.
To obtain your AccessKey
:
- Login or Signup for a free account on the Picovoice Console.
- Once logged in, go to the
AccessKey
tab to create one or use an existingAccessKey
.
Usage
Create a new instance of Picovoice runtime engine
from picovoice import Picovoice
access_key = "${ACCESS_KEY}" # AccessKey obtained from Picovoice Console (https://picovoice.ai/console/)
keyword_path = ...
def wake_word_callback():
pass
context_path = ...
def inference_callback(inference):
# `inference` exposes three immutable fields:
# (1) `is_understood`
# (2) `intent`
# (3) `slots`
pass
handle = Picovoice(
access_key=access_key,
keyword_path=keyword_path,
wake_word_callback=wake_word_callback,
context_path=context_path,
inference_callback=inference_callback)
handle
is an instance of Picovoice runtime engine that detects utterances of wake phrase defined in the file located at
keyword_path
. Upon detection of wake word it starts inferring user's intent from the follow-on voice command within
the context defined by the file located at context_path
. keyword_path
is the absolute path to
Porcupine wake word engine keyword file (with .ppn
suffix).
context_path
is the absolute path to Rhino Speech-to-Intent engine context file
(with .rhn
suffix). wake_word_callback
is invoked upon the detection of wake phrase and inference_callback
is
invoked upon completion of follow-on voice command inference.
When instantiated, valid sample rate can be obtained via handle.sample_rate
. Expected number of audio samples per
frame 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:
handle.process(get_next_audio_frame())
When done resources have to be released explicitly
handle.delete()
Non-English Models
In order to detect wake words and run inference in other languages you need to use the corresponding model file. The model files for all supported languages are available here and here.
Demos
picovoicedemo provides command-line utilities for processing real-time audio (i.e. microphone) and files using Picovoice platform.
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
Hashes for picovoice-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8928863b16aa2a238f9906f2895c280be6330c29ad9f51c994b65634501246a |
|
MD5 | 9057ae6d9db2656894214178b30a3994 |
|
BLAKE2b-256 | cf378e611850410b2523e87509c570feb80038a17f0c17d1262032c5dc6ffbea |