avs-device-sdk/extension/avs-cpp-sdk/README.md

112 lines
3.9 KiB
Markdown

# Instructions
Before building the SDK with the AVS SDK Adapter for Wakeword Lite, follow these
steps:
1. Download the AmazonLite wake word engine library.
Note: This AVS SDK Adapter is compatible only with wake word engine version 2.16.x or newer.
2. Have a copy of the AVS C++ SDK.
Note: This Adapter can only work with SDK's that meet the minimum version defined in
avs-cpp-sdk/KWD/CMakeLists.txt SDK_MIN_VER
3. Run CMAKE on the AVS C++ SDK passing AmazonLite arguments.
# Model selection
A model is the definition of how the AmazonLite wake word engine detects a wake
word. So each wake word on each language is defined by a specific model.
The AmazonLite wake word adapter allows for developers to embed a wake word
model in the executables. This is done during CMake call time. See the next
section for the CMake instructions.
If the binaries have an embedded model, the Amazon Lite wake word adapter can be
created using either this embedded model or a model stored on an external file.
If such embedded model is not present, passing the location of an external file
containing the model becomes mandatory. On the SampleApp, this file location
should be added to the `sampleApp.PryonLiteModelPath` field on the JSON
configuration file. See an example bellow:
```
{
(...)
"sampleApp": {
"PryonLiteModelPath":"/amazonlite/models/D.en-US.alexa.bin"
}
}
```
# Fingerprint List Selection
A fingerprint is a file containing a list of acoustic characteristics
identifying a wake word in media submitted to the wake word team, otherwise
known as "fingerprints". The wakeword engine matches the audio to these
"fingerprints" to determine if the wake word detected should be suppressed
or sent to the cloud.
The location of the fingerprint list file must be passed to the adapter. On
the SampleApp, this file location should be added to `sampleApp.PryonLiteFingerprintListPath`
field on the JSON configuration file. See an example below.
```
{
(...)
"sampleApp": {
"PryonLiteFingerprintListPath":"/amazonlite/fingerprints/fingerprint_test_list"
}
}
```
# Watermark Configuration Selection
A watermark configuration is a file containing watermarks the audio
is matched to in order to determine whether or not a wake word should be
suppressed or sent to the cloud.
The location of the watermark configuration file must be passed to the adapter. On
the SampleApp, this file location should be added to `sampleApp.PryonLiteWatermarkConfigPath`
field on the JSON configuration file. See an example below.
```
{
(...)
"sampleApp": {
"PryonLiteWatermarkConfigPath":"/amazonlite/watermarks/watermark_cfg.bin"
}
}
```
# Build arguments
To build the AVS Device SDK with the AmazonLite WWE, these CMake arguments can
be used:
```
-DAMAZONLITE_KEY_WORD_DETECTOR=ON
-DAMAZONLITE_KEY_WORD_DETECTOR_LIB_PATH=<path-to-lib>
-DAMAZONLITE_KEY_WORD_DETECTOR_INCLUDE_DIR=<path-to-directory>
-DAMAZONLITE_KEY_WORD_DETECTOR_EMBEDDED_MODEL_CPP_PATH=<path-to-model-cpp-file>
-DEXTENSION_PATH=<existing-extension-paths>;<path-to-source-dir/avs-cpp-sdk/KWD>
```
Here is what each argument means:
- `AMAZONLITE_KEY_WORD_DETECTOR=ON` - Enables the AmazonLite adapter.
- `AMAZONLITE_KEY_WORD_DETECTOR_LIB_PATH` - The location of the AmazonLite
library.
- `AMAZONLITE_KEY_WORD_DETECTOR_INCLUDE_DIR` - The directory where the
AmazonLite header files are located.
- `AMAZONLITE_KEY_WORD_DETECTOR_MODEL_CPP_PATH` - (optional) The location of a
C++ file containing a wake word model. If you pass this argument, the model
on the C++ file will be embedded into the binaries generated during
compilation and therefore will be always available. Example:
```
-DAMAZONLITE_KEY_WORD_DETECTOR_EMBEDDED_MODEL_CPP_PATH=/amazonlite/models/D.en-US.alexa.cpp
```
Needed for PryonLiteKeywordDetectorTest.cpp.
- `EXTENSION_PATH` - A semi-colon separated list of paths to search for CMake projects.
Add to this list the-path-to-this-directory/avs-cpp-sdk/KWD