Skip to content

Templates

Task templates are models that use composition to add behavior to basic model types. Templates have slots that you can fill with any model that has a task-type that matches what the slot expects.

The tpl-spot-vad-lvscr template, for example, waits for the wake word in slot 0, then runs the LVCSR or STT model in slot 1. The composed model has task-type == phrasespot and implements all of the events and settings expected of such a model type. You can use it as a drop-in replacement for a wake word in (say) live-spot.c without any code changes.

Compose new template-based models with snsr-edit, on the fly with snsr-eval, or by using the setStream function at runtime.

Composed models

tpl-spot-concurrent
Runs two wake word models at the same time. It provides a convenient way to create a single wake word model that has the combined vocabulary of two other models.
tpl-spot-debug
Adds runtime data collection to a wake word model. Use this to collect audio and event timings from an embedded model, snsr-log-split to extract audio, event logs, and the model itself from the generated log file, and audio-check to verify audio recording quality.
tpl-spot-select
Allows you to dynamically select which of the two embedded wake word models to run.
tpl-spot-sequential
Runs two wake word models in sequence. Use this to listen for a trigger phrase followed by a command, for example: "Voice genie, play music."
tpl-spot-vad
Runs the wake word in slot 0 until it detects, then does start- and endpoint detection with a VAD on the audio stream following the wake word.
tpl-opt-spot-vad-lvcsr tnl
Optionally runs the wake word in slot 0 until it detects, then segments the audio following the wake word with a VAD and sends the segmented audio to the LVCSR or STT recognizer in slot 1.
tpl-spot-vad-lvcsr tnl
Runs the wake word in slot 0 until it detects, segments the audio following the wake word with a VAD, and sends the segmented audio to the LVCSR or STT recognizer in slot 1.
tpl-vad-lvcsr tnl
Detects speech with a VAD and sends the segmented audio to the LVCSR or STT recognizer in slot 0.