
The install_language() function registers a language model in the ASR control structure. It unpacks the model binary from the flash
memory and assigns addresses and parameters into the linked list of language models.
The reference example is implemented in sln_local_voice.c.
Figure 60. Function install_language() snippet
• pAsrCtrl: ASR control structure, also shown in
.
• pLangModel: language model, also shown in
.
• lang: languages to be enabled. The types and encodings are listed in
.
• pAddrBin: address of the language model binary to be installed.
• nGroups: total number of groups (base + wake word +
N
command groups) where
N
depends on applications.
The install_inference_engine() function registers an inference engine (either for a wake word or command group
n
) in the ASR
control structure. It assigns a language’s base model and a wake word (or command) group from the language model to an
inference engine.
Figure 61. Function install_inference_engine() snippet
• pAsrCtrl: ASR control structure, also shown in
.
• pInfEngine: inference engine, either for a wake word or a command group, also shown in
.
• lang: languages to be enabled. The types and encodings are in
.
• infType: either a wake word or a command group, also shown in
.
• idToString: the string list that indicates which command/wake word is detected. The string is printed out in a terminal
window.
• addrMemPool: memory pool address in SRAM for an inference engine.
• sizeMemPool: size of an inference engine in a memory pool.
After the installation, the inference engines initialize their handlers. The handler within each instance should not be NULL, if the
installation and initialization are successful.
7.1.4 ASR session control
7.1.4.1 Follow-up mode
The SLN-LOCAL2-IOT ASR session supports the follow-up mode where you can continue saying voice commands after the wake
word is triggered once. For example, with the elevator voice control application, multiple passengers who go to different floors can
say a voice command one by one after the first passenger triggers the device with a wake word. The mode is configured by the
shell command in a serial terminal. You can see the command usage by typing “help”, as shown in
.
NXP Semiconductors
Far-field local voice control framework
SLN-LOCAL2-IOT Developer’s Guide, Rev. 0, 19 April 2021
User's Guide
50 / 87