File Simulators
File simulators are offline .wav file processor utilities to aid in evaluation of the Wake Word engine on pre-recoded audio files. It takes WAV files containing in a mono 16-bit 16 kHz audio format, a wake word model, and outputs detection events to stdout.
The file simulator application is provided only for those architectures where file I/O and stdio C run-time library functionality is readily available (i.e. x86, darwin, linux, etc.).
How to run the application
For an exhaustive list of options, run the application with -h
.
Locate the executable in the package
If supplied as part of the PryonLite package, an amazon_ww_filesim
application binary will be present in a given
<target>
subfolder. For example, an Ubuntu x86 version of the filesim application would be found in the x86
folder.
File simulators for V2 API are located in subfolders of the architecture folder. The following table shows locations of file simulator applications built for various API versions:
API / Version | File Simulator Location |
---|---|
v2 PRL1000 | ./<architecture>/PRL1000/amazon_filesim-PRL1000 |
v2 PRL2000 | ./<architecture>/PRL2000/amazon_filesim-PRL2000 |
Note
Some target subfolders will not contain an amazon filesim application binary. This is due to lack of the target's file i/o capabilities.
Prepare Input Audio List
If you have a directory containing the .wav files to process, run the following command to generate a list file with all the .wav files in that directory:
ls -1 *.wav > all_wavs.list
Tip
You can also run a single .wav file without a list. Just use the .wav file path instead of a list file path on the command line
Sample input
A sample WAV list file and associated .WAV files can be found in the following package locations:
./sample-wakeword/alexas.list
./sample-wakeword/alexa-*.wav
The list file will look like this:
alexa-01.wav
alexa-02.wav
alexa-03.wav
alexa-04.wav
alexa-05.wav
alexa-06.wav
alexa-07.wav
alexa-08.wav
alexa-09.wav
alexa-10.wav
Select a wake word model
The wake word model must be selected based on the paths specified by a particular architecture's WakewordModelMapping.json configuration file. For example, for the x86 (Ubuntu) architecture, the WakewordModelMapping.json file specifies that the following model is suitable for the x86 Ubuntu PryonLite engine:
common/D.en-US.alexa
The appropriate wake word model is then found in the 'models' subfolder, with a .bin extension. For example:
path_to_model = models/common/D.en-US.alexa.bin
For detailed information on model selection, see this section
Run the application
The application takes the wake word model and an audio list file in as command line parameters:
./<filesim application name> -m <path_to_model> all_wavs.list
To display a full list of options, run the filesim application with the '-h' option.
Reference file simulation output
Reference output from file simulation applications is provided in the package. In the example below, the reference file name is specifically for an x86 Ubuntu architecture using a D.en-US.alexa wake word model. Your package may contain a sample output for a different architecture or model, depending on your package request.
./sample-wakeword/ref-output-x86-D.en-US.alexa-alexas.list
The application output will look similar to the following:
Loaded model from path: models/common/D.en-US.alexa.bin
Decoder instance memory allocated: 266344
Model Version: en-US_D_ALEXA+STOP_2018SuperBowl_v5.0
Engine Version: 2.9.0
Supported keywords: ALEXA, STOP
Threshold: 500
alexa-01: 'ALEXA' detected during [0, 9600]
alexa-02: 'ALEXA' detected during [8640, 17920]
alexa-03: 'ALEXA' detected during [3680, 13920]
alexa-04: 'ALEXA' detected during [4480, 14720]
alexa-05: 'ALEXA' detected during [3040, 13280]
alexa-06: 'ALEXA' detected during [5440, 15680]
alexa-07: 'ALEXA' detected during [8800, 20480]
alexa-08: 'ALEXA' detected during [7840, 19520]
alexa-09: 'ALEXA' detected during [12000, 24160]
alexa-10: 'ALEXA' detected during [30400, 43040]
*** 10 wake word(s) detected in 10 files ***
Fingerprinting File Simulator
See the Fingerprinting Integration Guide for instructions on how to pass a fingerprint list to the file simulator.