---
source_path: "api/setting-keys/runtime.md"
canonical_url: "https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime/"
---

# Runtime

These settings inspect the state, or change the behavior, of [Session](https://doc.sensory.com/tnl/7.8/api/inference.md#session)
object instances. They are not serialized by [save](https://doc.sensory.com/tnl/7.8/api/inference.md#save) or [dup](https://doc.sensory.com/tnl/7.8/api/inference.md#dup).

Most applications will use [->audio-pcm](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#-audio-pcm) with [push](https://doc.sensory.com/tnl/7.8/api/inference.md#push) or [run](https://doc.sensory.com/tnl/7.8/api/inference.md#run) to
present audio samples to a recognition task. Other runtime keys come up
only in specific workflows: [grammar-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#grammar-stream) and [phrases-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#phrases-stream) for
custom LVCSR vocabularies, [dsp-target](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-target) for [THF Micro][] export, and
[add-context](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#add-context) / [delete-user](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#delete-user) / [rename-user](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#rename-user) for enrollment.

Access runtime settings with the [Session](https://doc.sensory.com/tnl/7.8/api/inference.md#session) `get` or `set` function that
matches the setting type. For example, use [setStream](https://doc.sensory.com/tnl/7.8/api/inference.md#setters) to change the
_(input stream)_ for [->audio-pcm](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#-audio-pcm).

<!-- Setting-key page conventions: shared admonition for all docs/api/setting-keys/*.md pages. -->
### Details: Page conventions

Settings are grouped by concern. Within each group they're listed
alphabetically. A setting that serves more than one concern appears once
under its primary group; secondary groups link to it.

The code tabs on each setting show one paste-able call site per language.
Adapt the placeholder names (`s` for the [Session](https://doc.sensory.com/tnl/7.8/api/inference.md#session), plus `value`,
`stream`, `on_event`, or `on_item` for the operand) to your code. Each
example assumes the language's standard prelude:

<!-- tab: c -->

**C/C++**

```c
#include <snsr.h>
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
import com.sensory.speech.snsr.Snsr;
import com.sensory.speech.snsr.SnsrSession;
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
import snsr
```
<!-- /tab -->

For the full Session lifecycle (`snsrNew`, `new SnsrSession()`,
`snsr.Session(...)`) see [Your first program](https://doc.sensory.com/tnl/7.8/getting-started/your-first-program.md#your-first-program).

## Audio I/O

### ->audio-pcm
- runtime
- input stream
- write-only

<!-- tab: c -->

**C/C++**

```c
snsrSetStream(s, SNSR_SOURCE_AUDIO_PCM, stream);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setStream(Snsr.SOURCE_AUDIO_PCM, stream);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_stream(snsr.SOURCE_AUDIO_PCM, stream)
```
<!-- /tab -->

Input audio stream.

This audio stream must be headerless, 16-bit LPCM-encoded, sampled
at 16 kHz, with little-endian byte ordering.

**Also see these related items:** [push](https://doc.sensory.com/tnl/7.8/api/inference.md#push), [run](https://doc.sensory.com/tnl/7.8/api/inference.md#run)

### ->feature
- runtime
- input stream
- write-only
- pre-release
<!-- tab: c -->

**C/C++**

```c
snsrSetStream(s, SNSR_SOURCE_FEATURE, stream);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setStream(Snsr.SOURCE_FEATURE, stream);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_stream(snsr.SOURCE_FEATURE, stream)
```
<!-- /tab -->

Input feature stream.

**Pre-release:**

This is an experimental feature. Do not use unless recommended by Sensory.

Source stream in a proprietary Sensory format.

### <-audio-pcm
- runtime
- output stream
- write-only

<!-- tab: c -->

**C/C++**

```c
snsrSetStream(s, SNSR_SINK_AUDIO_PCM, stream);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setStream(Snsr.SINK_AUDIO_PCM, stream);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_stream(snsr.SINK_AUDIO_PCM, stream)
```
<!-- /tab -->

Output audio stream.

Headerless audio output, 16-bit LPCM-encoded, sampled at 16 kHz,
with little-endian byte ordering.

### <-feature
- runtime
- output stream
- write-only
- pre-release
<!-- tab: c -->

**C/C++**

```c
snsrSetStream(s, SNSR_SINK_FEATURE, stream);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setStream(Snsr.SINK_FEATURE, stream);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_stream(snsr.SINK_FEATURE, stream)
```
<!-- /tab -->

Output feature stream.

**Pre-release:**

This is an experimental feature. Do not use unless recommended by Sensory.

Headerless feature output in a proprietary Sensory format.

### audio-stream-from
- runtime
- double
- read-write

<!-- tab: c -->

**C/C++**

```c
snsrSetDouble(s, SNSR_AUDIO_STREAM_FROM, value);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setDouble(Snsr.AUDIO_STREAM_FROM, value);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_double(snsr.AUDIO_STREAM_FROM, value)
```
<!-- /tab -->

Audio stream requested start index.

Start the next [audio-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/results.md#audio-stream) at this sample index value.
Defaults to [audio-stream-first](https://doc.sensory.com/tnl/7.8/api/setting-keys/results.md#audio-stream-first).

**Also see these related items:** [audio-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/results.md#audio-stream), [audio-stream-size](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#audio-stream-size)

### audio-stream-to
- runtime
- double
- read-write

<!-- tab: c -->

**C/C++**

```c
snsrSetDouble(s, SNSR_AUDIO_STREAM_TO, value);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setDouble(Snsr.AUDIO_STREAM_TO, value);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_double(snsr.AUDIO_STREAM_TO, value)
```
<!-- /tab -->

Audio stream requested end index.

End the next [audio-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/results.md#audio-stream) at this sample index value.
Defaults to [audio-stream-last](https://doc.sensory.com/tnl/7.8/api/setting-keys/results.md#audio-stream-last).

**Also see these related items:** [audio-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/results.md#audio-stream), [audio-stream-size](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#audio-stream-size)

## VAD & endpointing

### skip-to-ms
- runtime
- int
- write-only

<!-- tab: c -->

**C/C++**

```c
snsrSetInt(s, SNSR_SKIP_TO_MS, value);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setInt(Snsr.SKIP_TO_MS, value);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_int(snsr.SKIP_TO_MS, value)
```
<!-- /tab -->

VAD initial ignore duration, in ms.

Ignore the first `skip-to-ms` ms of the [->audio-pcm](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#-audio-pcm) input
stream. Use this runtime setting to skip over a trigger phrase included
in the source audio. The default is to process all audio.

**Also see these related items:** [skip-to-sample](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#skip-to-sample)

### skip-to-sample
- runtime
- int
- write-only

<!-- tab: c -->

**C/C++**

```c
snsrSetInt(s, SNSR_SKIP_TO_SAMPLE, value);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setInt(Snsr.SKIP_TO_SAMPLE, value);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_int(snsr.SKIP_TO_SAMPLE, value)
```
<!-- /tab -->

VAD initial ignore duration, in samples.

Ignore the first `skip-to-sample` samples of the [->audio-pcm](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#-audio-pcm)
input stream. Use this runtime setting to skip over a trigger phrase included
in the source audio. The default is to process all audio.

**Also see these related items:** [skip-to-ms](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#skip-to-ms)

## LVCSR & STT

### grammar-stream.
- runtime
- input stream
- write-only
- TrulyNatural only
<!-- tab: c -->

**C/C++**

```c
snsrSetStream(s, SNSR_GRAMMAR_STREAM, stream);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setStream(Snsr.GRAMMAR_STREAM, stream);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_stream(snsr.GRAMMAR_STREAM, stream)
```
<!-- /tab -->

Recognition grammar stream.

Creates a recognizer from a grammar specification read from a stream.
The grammar must use [UTF&#8209;8][UTF-8] encoding.
The new model will recognize only those phrases that the
grammar generates.

The model will be ready to recognize once [setStream](https://doc.sensory.com/tnl/7.8/api/inference.md#setters) returns.
For larger grammars the build process can take a significant amount of time.

See [grammar syntax](https://doc.sensory.com/tnl/7.8/models/types/lvcsr.md#grammar-syntax) for detail on how grammars are structured.

To create a grammar for a class, append the class name to `grammar-stream.`:

**Example:**

<!-- tab: c -->

**C/C++**

```c
snsrSetStream(session, SNSR_GRAMMAR_STREAM "classname", grammarStream);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
session.set(Snsr.GRAMMAR_STREAM + "classname", grammarStream);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
session.set_stream(snsr.GRAMMAR_STREAM + "classname", grammar_stream)
```
<!-- /tab -->

**Note:**

Requires a TrulyNatural model that supports building.

**Also see these related items:** [Stream](https://doc.sensory.com/tnl/7.8/api/io.md#stream), [phrases-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#phrases-stream)

### nlu-grammar-stream.
- runtime
- input stream
- write-only
_(TrulyNatural only)_ _(STT only)_
<!-- tab: c -->

**C/C++**

```c
snsrSetStream(s, SNSR_NLU_GRAMMAR_STREAM, stream);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setStream(Snsr.NLU_GRAMMAR_STREAM, stream);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_stream(snsr.NLU_GRAMMAR_STREAM, stream)
```
<!-- /tab -->

NLU grammar stream.

Creates a lightweight NLU parser from a grammar specification read from
a stream. It takes precedence over NLU specified with [grammar-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#grammar-stream)
and can be used as an alternative to machine-learned NLU in some
STT models.

The grammar must use [UTF&#8209;8][UTF-8] encoding.
The NLU model will recognize only those phrases that the
grammar generates.

The NLU parser is applied to the recognition result,
[^result](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#result), and generates [^nlu-intent](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#nlu-intent) and [^nlu-slot](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#nlu-slot) events for
each match found.

The model will be ready to recognize once [setStream](https://doc.sensory.com/tnl/7.8/api/inference.md#setters) returns.
For larger grammars the build process can take a significant amount of time.

See [grammar syntax](https://doc.sensory.com/tnl/7.8/models/types/lvcsr.md#grammar-syntax) for detail on how grammars are structured.

To create a grammar for a class, append the class name to `nlu-grammar-stream.`:

**Example:**

<!-- tab: c -->

**C/C++**

```c
snsrSetStream(session, SNSR_NLU_GRAMMAR_STREAM "classname", grammarStream);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
SnsrSession.set(Snsr.NLU_GRAMMAR_STREAM + "classname", grammarStream);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
session.set_stream(snsr.NLU_GRAMMAR_STREAM + "classname", grammar_stream)
```
<!-- /tab -->

**Note:**

* Requires a TrulyNatural model that supports building.
*  If the model includes a machine-learned NLU component
  and the grammar-based NLU finds a match, this match replaces the
  machine learned-result completely.
  Before release 7.8.0 the `nlu-grammar-stream` result replaced the
  machine-learned result even if it found no matches.

**Also see these related items:** [grammar-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#grammar-stream), [^nlu-intent](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#nlu-intent), [^nlu-slot](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#nlu-slot)

### phrases-stream.
- runtime
- input stream
- write-only
- TrulyNatural only
<!-- tab: c -->

**C/C++**

```c
snsrSetStream(s, SNSR_PHRASES_STREAM, stream);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setStream(Snsr.PHRASES_STREAM, stream);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_stream(snsr.PHRASES_STREAM, stream)
```
<!-- /tab -->

Recognition phrase list stream.

Creates a recognizer from a list of phrases read from a stream.
The phrase list must use [UTF&#8209;8][UTF-8] encoding.
Individual phrases are separated by newlines or semicolons.
Comments start with `#` and run until the end of the phrase.
Only the exact phrases in the list will be part of the recognition language.

This utility setting converts the list of phrases into this
grammar specification:
```
g = <s> ( phrase0 | phrase1 | ... | phraseN) </s>;
```

To create a phrase list for a class, append the class name to `phrases-stream.`:

**Example:**

<!-- tab: c -->

**C/C++**

```c
const char *phrases = "hello world; this is a test sentence";
snsrSetStream(session, SNSR_PHRASES_STREAM "classname", snsrStreamFromString(phrases));
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
String phrases = "hello world; this is a test sentence";
session.set(Snsr.PHRASES_STREAM + "classname", SnsrStream.fromString(phrases));
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
phrases = "hello world; this is a test sentence"
session.set_stream(
    snsr.PHRASES_STREAM + "classname",
    snsr.Stream.from_string(phrases),
)
```
<!-- /tab -->

**Note:**

Requires a TrulyNatural model that supports building.

**Also see these related items:** [Stream](https://doc.sensory.com/tnl/7.8/api/io.md#stream), [grammar-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#grammar-stream)

## Enrollment & adaptation

### add-context
- runtime
- int
- read-write

<!-- tab: c -->

**C/C++**

```c
snsrSetInt(s, SNSR_ADD_CONTEXT, value);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setInt(Snsr.ADD_CONTEXT, value);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_int(snsr.ADD_CONTEXT, value)
```
<!-- /tab -->

Current enrollment includes trailing context.

Set to `1` if the enrollment recording should include trailing context,
for example: `"Hey Sensory will it rain tomorrow?"`

**Also see these related items:** [^resume](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#resume)

### delete-user
- runtime
- string
- write-only

<!-- tab: c -->

**C/C++**

```c
snsrSetString(s, SNSR_DELETE_USER, "text");
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setString(Snsr.DELETE_USER, "text");
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_string(snsr.DELETE_USER, "text")
```
<!-- /tab -->

Delete an enrolled user.

Deletes the named user, then:

* invokes [^enrolled](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#enrolled) event,
* invokes [^adapted](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#adapted) event iff any enrolled users remain,
* invokes [^done](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#done) event.

**Also see these related items:** [^adapted](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#adapted), [^done](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#done), [^enrolled](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#enrolled)

### re-adapt
- runtime
- int
- write-only

<!-- tab: c -->

**C/C++**

```c
snsrSetInt(s, SNSR_RE_ADAPT, value);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setInt(Snsr.RE_ADAPT, value);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_int(snsr.RE_ADAPT, value)
```
<!-- /tab -->

Force re-adaptation of all enrollments.

If all users in an enrollment task have been adapted, the adaptation
step is skipped. This is the case when one or more adapted enrollment
contexts are loaded, and no new users are added.

Setting `re-adapt` to `1` changes this behavior to always do the adaptation step.

**Also see these related items:** [^adapted](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#adapted)

### rename-user
- runtime
- string
- write-only

<!-- tab: c -->

**C/C++**

```c
snsrSetString(s, SNSR_RENAME_USER, "text");
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setString(Snsr.RENAME_USER, "text");
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_string(snsr.RENAME_USER, "text")
```
<!-- /tab -->

Rename an enrolled user.

Changes the recognition result returned for [user](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#user) to the string
argument.

This setting is only available in fixed-phrase spotters that
support continuous adaptation.

**Example:**

<!-- tab: c -->

**C/C++**

```c
snsrSetString(s, SNSR_USER, "original-user/phrase");
snsrSetString(s, SNSR_RENAME_USER, "new-user/new-phrase");
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
session.setString(Snsr.USER, "original-user/phrase");
session.setString(Snsr.RENAME_USER, "new-user/new-phrase");
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
session.set_string(snsr.USER, "original-user/phrase")
session.set_string(snsr.RENAME_USER, "new-user/new-phrase")
```
<!-- /tab -->

**Also see these related items:** [^adapted](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#adapted), [^new-user](https://doc.sensory.com/tnl/7.8/api/setting-keys/events.md#new-user)

## Push / pull execution

### auto-flush
- runtime
- int
- read-write
- deprecated [6.20.0](https://doc.sensory.com/tnl/7.8/changes/version-6.md#v6.20.0)
<!-- tab: c -->

**C/C++**

```c
snsrSetInt(s, SNSR_AUTO_FLUSH, value);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setInt(Snsr.AUTO_FLUSH, value);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_int(snsr.AUTO_FLUSH, value)
```
<!-- /tab -->

Recognition pipeline end-of-stream flush behavior.

**Deprecated:**

Use [push](https://doc.sensory.com/tnl/7.8/api/inference.md#push) and [stop](https://doc.sensory.com/tnl/7.8/api/inference.md#stop) in new code instead.

This boolean value controls whether [run](https://doc.sensory.com/tnl/7.8/api/inference.md#run) flushes the recognition
pipeline when one (or more) of the input streams report an end-of-file
condition.

The default value is `1`, which enables automatic flushing on [EOF](https://doc.sensory.com/tnl/7.8/api/inference.md#rc_eof).
This is appropriate for most applications.
Set `auto-flush` to `0` when audio is presented to [run](https://doc.sensory.com/tnl/7.8/api/inference.md#run) in small
segments.

**Also see these related items:** [run](https://doc.sensory.com/tnl/7.8/api/inference.md#run), [push](https://doc.sensory.com/tnl/7.8/api/inference.md#push), [stop](https://doc.sensory.com/tnl/7.8/api/inference.md#stop)

## THF Micro DSP

### dsp-acmodel-stream
- runtime
- output stream
- read-only

<!-- tab: c -->

**C/C++**

```c
SnsrStream stream;
snsrGetStream(s, SNSR_EMBEDDED_ACMODEL_STREAM, &stream);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
SnsrStream stream = s.getStream(Snsr.EMBEDDED_ACMODEL_STREAM);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
stream = s.get_stream(snsr.EMBEDDED_ACMODEL_STREAM)
```
<!-- /tab -->

Embedded device acoustic model data.

**Also see these related items:** [THF Micro][], [dsp-target](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-target), [dsp-header-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-header-stream),
[dsp-search-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-search-stream), [dsp.production-ready](https://doc.sensory.com/tnl/7.8/api/setting-keys/results.md#dspproduction-ready), [dsp.t-slice-version](https://doc.sensory.com/tnl/7.8/api/setting-keys/results.md#dspt-slice-version)

### dsp-header-stream
- runtime
- output stream
- read-only

<!-- tab: c -->

**C/C++**

```c
SnsrStream stream;
snsrGetStream(s, SNSR_EMBEDDED_HEADER_STREAM, &stream);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
SnsrStream stream = s.getStream(Snsr.EMBEDDED_HEADER_STREAM);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
stream = s.get_stream(snsr.EMBEDDED_HEADER_STREAM)
```
<!-- /tab -->

Embedded device search header.

**Also see these related items:** [dsp-target](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-target),[dsp-acmodel-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-acmodel-stream), [dsp-search-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-search-stream),
[dsp.t-slice-version](https://doc.sensory.com/tnl/7.8/api/setting-keys/results.md#dspt-slice-version)

### dsp-search-stream
- runtime
- output stream
- read-only

<!-- tab: c -->

**C/C++**

```c
SnsrStream stream;
snsrGetStream(s, SNSR_EMBEDDED_SEARCH_STREAM, &stream);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
SnsrStream stream = s.getStream(Snsr.EMBEDDED_SEARCH_STREAM);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
stream = s.get_stream(snsr.EMBEDDED_SEARCH_STREAM)
```
<!-- /tab -->

Embedded device search model data.

**Also see these related items:** [dsp-target](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-target), [dsp-acmodel-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-acmodel-stream), [dsp-header-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-header-stream),
[dsp.t-slice-version](https://doc.sensory.com/tnl/7.8/api/setting-keys/results.md#dspt-slice-version)

### dsp-target
- runtime
- string
- read-write

<!-- tab: c -->

**C/C++**

```c
snsrSetString(s, SNSR_EMBEDDED_TARGET, "text");
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setString(Snsr.EMBEDDED_TARGET, "text");
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_string(snsr.EMBEDDED_TARGET, "text")
```
<!-- /tab -->

Embedded (DSP) device target name.

**Also see these related items:** [THF Micro][], [dsp-acmodel-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-acmodel-stream), [dsp-header-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-header-stream),
[dsp-search-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-search-stream), [dsp.t-slice-version](https://doc.sensory.com/tnl/7.8/api/setting-keys/results.md#dspt-slice-version)

## Identity & metadata

### model-license-exp-date
- runtime
- double
- read-only

<!-- tab: c -->

**C/C++**

```c
double value;
snsrGetDouble(s, SNSR_MODEL_LICENSE_EXPDATE, &value);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
double value = s.getDouble(Snsr.MODEL_LICENSE_EXPDATE);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
value = s.get_double(snsr.MODEL_LICENSE_EXPDATE)
```
<!-- /tab -->

Model license expiration date.

Returns the license expiration date of the most recently loaded
model in seconds since the [epoch][], or `0` if no model is loaded.

For production keys, which never expire, the expiration date is `0`.

<!-- To do, add Java, JavaScript examples -->
**Example:**

```c
double e;
time_t expdate;
snsrGetDouble(s, SNSR_MODEL_LICENSE_EXPDATE, &e);
expdate = (time_t)e;
```

**Also see these related items:** [model-license-exp-message](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#model-license-exp-message)

### model-license-exp-message
- runtime
- string
- read-only

<!-- tab: c -->

**C/C++**

```c
const char * value;
snsrGetString(s, SNSR_MODEL_LICENSE_EXPIRES, &value);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
String value = s.getString(Snsr.MODEL_LICENSE_EXPIRES);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
value = s.get_string(snsr.MODEL_LICENSE_EXPIRES)
```
<!-- /tab -->

Model license expiration message.

Returns an expiration message string for the most recently loaded
model, or  `NULL` if no model is loaded.

The returned string is of the form `"Model license expires on <date>"`,
or `NULL` for model license keys that do not expire.

<!-- To do, add Java, JavaScript examples -->
**Example:**

```c
const char *expires;
snsrGetString(s, SNSR_MODEL_LICENSE_EXPIRES, &expires);
if (expires) fprintf(stderr, "%s\n", expires);
```

**Also see these related items:** [model-license-exp-date](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#model-license-exp-date), [model-license-exp-warn](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#model-license-exp-warn)

### model-license-exp-warn
- runtime
- string
- read-only

<!-- tab: c -->

**C/C++**

```c
const char * value;
snsrGetString(s, SNSR_MODEL_LICENSE_WARNING, &value);
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
String value = s.getString(Snsr.MODEL_LICENSE_WARNING);
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
value = s.get_string(snsr.MODEL_LICENSE_WARNING)
```
<!-- /tab -->

Model license expiration warning message.

This value is `NULL` for models with license keys that either do not expire,
or that have an expiration date that is more than 60 days into the future.

For license keys expiring in 60 days or fewer, the returned string
will be of the form `"License will expire in 37 days."`.

**Also see these related items:** [model-license-exp-date](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#model-license-exp-date), [model-license-exp-message](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#model-license-exp-message)

### model-name
- runtime
- string
- read-write

<!-- tab: c -->

**C/C++**

```c
snsrSetString(s, SNSR_MODEL_NAME, "text");
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setString(Snsr.MODEL_NAME, "text");
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_string(snsr.MODEL_NAME, "text")
```
<!-- /tab -->

Source model name.

The name of the model file used to create:

- ROM-able C code with [save](https://doc.sensory.com/tnl/7.8/api/inference.md#save) and [SOURCE](https://doc.sensory.com/tnl/7.8/api/inference.md#fm_source).
- A model in one of the supported embedded formats with [dsp-header-stream](https://doc.sensory.com/tnl/7.8/api/setting-keys/runtime.md#dsp-header-stream).

This value is included in the comment header of the generated code, for
information only.

### model:ids
- runtime
- string
- read-write

<!-- tab: c -->

**C/C++**

```c
snsrSetString(s, SNSR_PREPARE_SUBSET_INIT, "text");
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setString(Snsr.PREPARE_SUBSET_INIT, "text");
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_string(snsr.PREPARE_SUBSET_INIT, "text")
```
<!-- /tab -->

Prepares a [Session](https://doc.sensory.com/tnl/7.8/api/inference.md#session) for generating custom initialization code.

Set this value to `NULL` to enable [load](https://doc.sensory.com/tnl/7.8/api/inference.md#load) instrumentation. This is used
by [save](https://doc.sensory.com/tnl/7.8/api/inference.md#save) with [SUBSET_INIT](https://doc.sensory.com/tnl/7.8/api/inference.md#fm_subset_init) to generate custom library
initialization code (in C), which references only modules encountered
during [load](https://doc.sensory.com/tnl/7.8/api/inference.md#load).

Linking against only a subset of available modules reduces executable size.

This example will create a `custom-init.c` file. Add this to the build, and
recompile with `-DSNSR_USE_SUBSET` to enable. The linked executable(s) will
contain just the modules required to run `model-a.snsr` and `model-b.snsr`.
See [Compile-time macros § SNSR_USE_SUBSET](https://doc.sensory.com/tnl/7.8/api/compile-macros.md#snsr-use-subset).

<!-- tab: c -->

**C/C++**

**Example:**

```c
SnsrSession s;
snsrNew(&s);
snsrSetString(s, SNSR_PREPARE_SUBSET_INIT, NULL);
snsrLoad(s, snsrStreamFromFileName("model-a.snsr", "r"));
snsrLoad(s, snsrStreamFromFileName("model-b.snsr", "r"));
snsrSave(s, SNSR_FM_SUBSET_INIT, snsrStreamFromFileName("custom-init.c", "w"));
snsrRelease(s);
```

<!-- /tab -->

**Also see these related items:** [load](https://doc.sensory.com/tnl/7.8/api/inference.md#load), [save](https://doc.sensory.com/tnl/7.8/api/inference.md#save), [SUBSET_INIT](https://doc.sensory.com/tnl/7.8/api/inference.md#fm_subset_init)

### prune:enable
- runtime
- string
- read-write
<!-- tab: c -->

**C/C++**

```c
snsrSetString(s, SNSR_PRUNE_SETTINGS, "text");
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setString(Snsr.PRUNE_SETTINGS, "text");
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_string(snsr.PRUNE_SETTINGS, "text")
```
<!-- /tab -->

Prepare a [Session](https://doc.sensory.com/tnl/7.8/api/inference.md#session) for pruning model settings

Pruning unused settings from a model reduces peak RAM requirements.
This is typically only useful on platforms where heap memory is constrained.

Set `prune:enable` to `yes` to instrument model loading and running.
This instrumentation:

* Keeps track of which configuration settings the application
  accesses during model evaluation,
* adds a list of these settings to the model upon saving, and
* configures the model to prune settings not on this list from
  the runtime directly after loading.

Set `prune:enable` to `no` to disable pruning. This is the default.

**Note:**

Pruned models do not contain enough information to be re-saved.

**Also see these related items:** [load](https://doc.sensory.com/tnl/7.8/api/inference.md#load), [save](https://doc.sensory.com/tnl/7.8/api/inference.md#save)

### tag-identifier
- runtime
- string
- read-write

<!-- tab: c -->

**C/C++**

```c
snsrSetString(s, SNSR_TAG_IDENTIFIER, "text");
```
<!-- /tab -->

<!-- tab: java -->

**Java**

```java
s.setString(Snsr.TAG_IDENTIFIER, "text");
```
<!-- /tab -->

<!-- tab: py -->

**Python**

```python
s.set_string(snsr.TAG_IDENTIFIER, "text")
```
<!-- /tab -->

Exported identifier in ROM C code.

When text segment C code is created with [save](https://doc.sensory.com/tnl/7.8/api/inference.md#save) and [SOURCE](https://doc.sensory.com/tnl/7.8/api/inference.md#fm_source), this
setting specifies the name of the exported data structure.

 The value must start with an ASCII alphabetic character or `_`, and contain
 only alphanumerics and `_`; it must match regular expression `[A-Za-z_][A-Za-z0-9_]*`

<!-- Reference definitions from includes/links.md -->
[epoch]: https://en.wikipedia.org/wiki/Unix_time "Unix time"
[THF Micro]: https://doc.sensory.com/thf-micro/ "THF Micro documentation"
[UTF-8]: https://en.wikipedia.org/wiki/UTF-8

<!-- Abbreviation definitions from includes/abbreviations.md -->
*[API]: Application Programming Interface
*[iff]: if, and only if
*[LPCM]: Linear pulse-code modulation
*[LVCSR]: Large Vocabulary Continuous Speech Recognition model, feed-forward neural net acoustic model with FST decoder
*[NLU]: Natural Language Understanding model
*[RAM]: Random Access Memory
*[ROM]: Read-Only Memory, typically nonvolatile flash memory
*[STT]: Speech To Text: transformers with language model and CTC decoding
*[THF]: TrulyHandsfree, Sensory's wake word and command recognition technology
*[TNL]: TrulyNatural, Sensory's large-vocabulary speech recognition technology
*[VAD]: Voice Activity Detector
