Note that the optimizer tool in this repository can only generate keyword files for Linux, Mac, and Windows. Furthermore these models are intended for non-commercial use only and their use in a commercial product is prohibited. For more detail refer to our license terms. Finally a model file is valid for 30 days but you can always use the optimizer to generate a new one.
The optimizer enables developers to evaluate models for their wake words of choice. Below it is assumed that the current
working directory is the root of the repository. ${SYSTEM}
refers to the operating system (linux, mac, or windows)
and ${MACHINE}
refers to CPU architecture (x86_64 or amd64).
The optimizer utility is located at /tools/optimizer.
tools/optimizer/${SYSTEM}/${MACHINE}/pv_porcupine_optimizer -h
gives the usage string as below
[INFO] Usage: pv_porcupine_optimizer -r resource_directory -w keyword -p platform -o output_directory
[INFO] Optimizes keyword spotting model (aka porcupine) for a given keyword and stores the result into a file.
[INFO]
[INFO] -r Absolute path to resource directory that contains data needed by optimizer.
[INFO] -w Keyword.
[INFO] -p Target platform for running keyword spotting module. Valid options are: linux, mac, and windows.
[INFO] -o Absolute path to output directory where keyword file will be stored.
In this repository, the resource directory is located at /resources. Keyword files are
platform dependent. This means that a keyword file generated with -p linux
cannot run on Android or Mac. The
optimizer available at this repository can produce keyword files for Linux (x86_64), Mac, and Windows platforms. Note
that the generated keyword files can only be used for non-commercial and evaluation purposes and are valid for 30 days.
If you are working on a non-commercial application you can regenerate the file when it expires and keep using it.
Custom keyword files for other platforms are only provided with purchase of the commercial license. In order to purchase a commercial license contact us.
A keyword file for Vancouver targeted for a Mac machine can be created using
tools/optimizer/${SYSTEM}/${MACHINE}/pv_porcupine_optimizer -r resources/optimizer_data -w "vancouver" -p mac -o ~/
The optimizer provided in this repository does not have the capability to do so. Custom keyword files for platforms other than Linux, Mac, or Windows can be generated by Picovoice engineering team for a one-time NRE fee and are only provided with purchase of evaluation or commercial license. For more information, please contact us at sales@picovoice.ai.
The optimizer has information about tens of thousands of commonly-used English words. That being said, your chosen keyword might not be available in its internal dictionary. If you are interested to engage in commercial capacity, Picovoice engineering team can create the custom models that can’t be generated by the optimizer tool for one-time NRE fee
This happens when the keyword is very short (e.g. "No") or very long (e.g. "this is a very descriptive keyword"). The optimizer expects a certain length range for wake phrase and throws this error if the length is out of range. A typical wake phrase is expected to be either a single word with multiple syllables (e.g. "Alexa") or a two word phrase (e.g. "Hey Siri" or "OK Google").