tpl-spot-debug¶
This template 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-debug has task-type==phrasespot.
Expected task types:
- Slot 0: phrasespot
Operation¶
flowchart TD
start0((start))
log@{ shape: doc, label: "debug-log-file" }
start0 --> start
slot0 -.-> log
subgraph slot0[**slot 0** (phrasespot)]
start((start))
fetch[/samples from ->audio-pcm/]
audio(^sample-count)
process
result(^result)
start --> fetch
fetch --> audio
audio --> process
process --> fetch
process -->|recognize| result
result --> fetch
end - Read audio data from ->audio-pcm.
- Invoke ^sample-count.
- Invoke ^result if processing detects a vocabulary phrase.
- Continue processing until STREAM_END occurs on ->audio-pcm, or one of the event handlers returns a code other than OK.
Register callback handlers with setHandler only for those events you're interested in.
Settings¶
operating-point-iterator, vocab-iterator
audio-stream, audio-stream-first, audio-stream-last
->audio-pcm, audio-stream-from, audio-stream-to, dsp-acmodel-stream, dsp-header-stream, dsp-search-stream
0, audio-stream-size, debug-log-file, delay, dsp-target, duration-ms, include-model, listen-window, low-fr-operating-point, operating-point, samples-per-second, sv-threshold
live-spot.c, snsr-eval.c, PhraseSpot.java, segmentSpottedAudio.java
Notes¶
You must specify the name of the log file with debug-log-file.
include-model controls whether the log file includes a copy of the original task model. This is enabled by default.
The combined model is a wake word that you can use as a drop-in replacement for the original wake word without any API changes.
Log files include time-stamped entries with:
- SDK library information,
- the spotter model being used,
- audio samples, and
- event callbacks.
Extract text, model and audio data from the log file with the snsr-log-split utility.
Examples¶
% cd ~/Sensory/TrulyNaturalSDK/7.6.1
% bin/snsr-edit -o hbg-debug.snsr\
-t model/tpl-spot-debug-1.5.1.snsr\
-f 0 model/spot-hbg-enUS-1.4.0-m.snsr\
-s debug-log-file=hbg-debug.snsrlog
% bin/snsr-eval -t hbg-debug.snsr
2925 3690 hello blue genie
4995 5790 hello blue genie
7920 8640 hello blue genie
^C
# The error below is harmless and expected because we
# interrupted snsr-eval with ^C
% bin/snsr-log-split -vv hbg-debug.snsrlog
Writing to './'
Processing hbg-debug.snsrlog
-> audio ./hbg-debug.wav
-> event ./hbg-debug.txt
-> model ./hbg-debug.snsr
Error: Input file "hbg-debug.snsrlog" is truncated.
Processed 1273 items.