---
source_path: "tools/snsr-edit.md"
canonical_url: "https://doc.sensory.com/tnl/7.8/tools/snsr-edit/"
---

# snsr-edit

This tool edits default task settings, and composes specialized
tasks by filling template task slots with spotter models.

**Also see these related items:** [snsr-edit.c](https://doc.sensory.com/tnl/7.8/api/sample/c/snsr-edit.md#snsr-editc)

## 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](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#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](https://doc.sensory.com/tnl/7.8/models/types/wake-word.md#wake-word-type) task description for a list of valid setting names.

```console
% 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 a standard
[wake word](https://doc.sensory.com/tnl/7.8/models/types/wake-word.md#wake-word-type) task that spots the vocabulary from
_spot-hbg-enUS-1.4.0-m.snsr_ and _enrolled-sv-0.snsr_ at the same time.

```console
% 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.
```console
% 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. See [Compile-time macros](https://doc.sensory.com/tnl/7.8/api/compile-macros.md#compile-time-macros).
```console
% snsr-edit -v -i -t spot-hbg-enUS-1.4.0-m.snsr -t spot-music-enUS-1.2.0-m.snsr
Output written to "snsr-custom-init.c".
```

<!-- Abbreviation definitions from includes/abbreviations.md -->
*[API]: Application Programming Interface
*[TNL]: TrulyNatural, Sensory's large-vocabulary speech recognition technology
*[UDT]: User-Defined Trigger: enrolled wake words and command sets
