On-Device Fingerprinting Integration Guide
The following outlines the steps required to implement On-Device Fingerprinting.
Add fingerprinting to existing Wake Word Application.
To enable on-device fingerprinting, additional configuration values must be set in the configuration structure.
PryonLiteV2Config has a fingerprinter field. This field should be a pointer to a structure containing three additional fields for fingerprinting. To enable fingerprinting, the fingerprintList field must be set to a buffer containing the fingerprint list binary, and the sizeofFingerprintList field must pass in the size of the list.
PryonLiteFingerprintConfig engineConfig;
// Fingerprinting configuration
PryonLiteFingerprintConfig fingerprintConfig = PryonLiteFingerprintConfig_Default;
// Example value; size of the fingerprint list binary in bytes
fingerprintConfig->sizeofFingerprintList = 27045;
fingerprintConfig->fingerprintList = &fingerprintListBuffer;
// Load the fingerprint config into the engine configuration.
engineConfig.fingerprinter = &fingerprintConfig;
The complete setup can be found in the example file api_sample_PRL2000.cpp packaged with the library.
Testing On-Device Fingerprinting
A test fingerprint list binary and a matching sample audio file are found in the samples/fingerprinting folder. PryonLiteV2Config.fingerprinter.fingerprintList must be set to the memory address of the the test fingerprint list binary. Modify the sizeofFingerprintList field to the size of the fingerprint list binary in bytes.
The audio can then be pushed to the PryonLite engine instance initialized above. The wake word in the sample audio file will be matched and suppressed and no wake word detection event happens.
If the PryonLiteFingerprintMatchEvent is enabled, the engine will call the handler provided by the application. The handler may then print out the event to a console log.
Sample Wake Word Engine Application
A sample PryonLite engine application is included in the package. It can be run on the sample audio file and fingerprint list by preparing the audio file list with the samples/fingerprinting folder as per Prepare Input Audio List and using the below command.
For PRL1000:
PRL1000 does not support fingerprinting.
For PRL2000:
./<architecture>/amazon_filesim-PRL2000 -m models/<model_format>/D.en-US.alexa.bin samples/fingerprinting/all_wavs.list -f samples/fingerprinting/fingerprint_test_list