snsr-edit¶
This tool edits default task settings, and composes specialized tasks by filling template task slots with spotter models.
Usage¶
Edits/modifies TrulyNatural SDK .snsr model files.
usage: snsr-edit -t task [options]
options:
-C tag-identifier : emit C source to load model into RAM
-c tag-identifier : emit C source to run model from code space
-e setting filename : extract task setting/slot into filename
-f setting filename : load filename into task setting/slot
-g setting value : load string into task setting
-i : emit custom initialization code
-o out : output filename
-p : prune unused settings to reduce model size
-q setting : query a task setting
-s setting=value : override a task setting
-t task : specify task filename (required)
-v [-v [-v]] : increase verbosity
Settings are strings used as keys to query or change task behavior.
Most frequently used are operating-point for wake words and command sets,
leading-silence and trailing-silence for VAD templates,
partial-result-interval for LVCSR and STT, and stt-profile for STT models.
Refer to the TrulyNatural SDK documentation for a complete list and
descriptions of all supported settings.
Examples¶
Query and change the default operating-point. This creates a new file, hbg-3.snsr, which is a copy of spot-hbg-enUS-1.4.0-m.snsr with a less accepting default operating point.
See the wake word task description for a list of valid setting names.
% snsr-edit -t spot-hbg-enUS-1.4.0-m.snsr -q operating-point
operating-point = 10
% snsr-edit -t spot-hbg-enUS-1.4.0-m.snsr -s operating-point=3 -o hbg-3.snsr
% snsr-edit -t hbg-3.snsr -q operating-point
operating-point = 3
Create a new spotter task model that runs a fixed phrase spotter and an enrolled spotter (user-defined or fixed-trigger) at the same time. tpl-spot-concurrent-1.5.0.snsr is a template with two slots, named 0 and 1. The combined model fixed+udt.snsr is standard wake word task that spots the vocabulary from spot-hbg-enUS-1.4.0-m.snsr and enrolled-sv-0.snsr at the same time.
% snsr-edit -v -t tpl-spot-concurrent-1.5.0.snsr\
-f 0 spot-hbg-enUS-1.4.0-m.snsr\
-f 1 enrolled-sv-0.snsr -o fixed+udt.snsr
Saved edited model to "fixed+udt.snsr".
Convert a spotter model to C code.
% snsr-edit -v -c voicegenie -t spot-voicegenie-enUS-6.5.1-m.snsr
Saved edited model to "spot-voicegenie-enUS-6.5.1-m.c".
% head -20 spot-voicegenie-enUS-6.5.1-m.c
Create custom TrulyNatural initialization code that limits code references to those modules needed to run the spot-hbg-enUS-1.4.0-m.snsr spot-music-enUS-1.2.0-m.snsr models. Include the generated snsr-custom-init.c file in your application build, and compile with -DSNSR_USE_SUBSET. This will reduce the application code size by limiting its capabilities to run snsr models to just the models used to create the custom initialization.