Skip to main content
Skip table of contents

Configuration file

In this page, a complete description of the configuration file required by the VASR (VASR - C++) engine is provided.
This table explains what are the different field for, their range of possible values (if application) and their default value (if any).

Note that on Android the log/<name>/sink and log/<name>/sink_options are ignored

Field path

Optional

Value type

Range

Default value

Description

paths

Object

N / A

Object that contains the different path required by the engine to load specific resources

paths/data_root

String

N / A

.

Base location where the engine will load resources from. If relative, it will be based on the configuration file base path

paths/acmod

String

acmod

Directory where acoustic models (.vam) will be loaded from. If relative, it will be based on the data_root path

paths/graph

String

graph

Directory where compiled grammars (.vgg) will be loaded from. If relative, it will be based on the data_root path

paths/log

String

log

Directory where log will be placed. If relative, it will be based on the data_root path

log

Object

N / A

Object that contains all the logging configuration of VASR

log/<name>

Object

N / A

Configuration for the logger <name>. Possible logger names are [vasr (the default logger), perf (the performance logger), recognizer:<name> (the recognizer named name), model:<name> (the model named name)]. It it also possible tu use wildcard as specific places to configure multiple logger at once. Here are the allowed values: [*, recognizer:*, model:*]

log/<name>/level

String

[trace, debug, info, warning, warn, error, err, critical, off]

info

Set the minimal log level for this logger. Note that setting this will print the level specified and everything above the level e.g. setting the level to warning will still print error and critical messages. Of course warn and warning / err and error are equivalent

log/<name>/sink

String

[stdout, stdout-color, stderr, stderr-color, file]

stdout-color

Set the destination of log messages for this logger

log/<name>/sink_options

Object

N / A

Contains all options specific to the type of sink

log/<name>/sink_options/path

String

(For file sink type only) Set the output file path. If relative, it will be based on the paths/log path

log/<name>/sink_options/max_size

Int

[1'024 - inf]

(For file sink type only) Specify the maximum file size (in kbytes) before rotating the file

log/<name>/sink_options/max_file

Int

[1 - inf]

(For file sink type only) Specify the maximum number of log file that will be kept

log/<name>/sink_options/truncate

Boolean

false

(For file sink type only) If set to true file will be truncate / rotate (depending if the maxsize / maxfile options have been specified or not) when the engine is created

asr

Object

N / A

Object that contains all the configuration of VASR

asr/recognizers

Object

N / A

List here all recognizer that will be created during run-time

asr/recognizers/<name>

Object

N / A

Specify the definition of a recognizer. The name is completely free and will be used in the code to create the Recognizer object

asr/recognizers/<name>/acmods

Array

N / A

A list of all the path to the acoustic model that will be loaded and used by this recognizer. If relative, it will be based on the paths/acmod path

asr/recognizers/<name>/settings

Object

N / A

Additional settings that will be passed to every acoustic model of this recognizer

asr/recognizers/<name>/settings/min_speech_duration

Int

[100 - 10'000]

500

Amount of time (in milliseconds) that speech needs to be detected before triggering a recognition. Note that after a successful trigger the X ms of audio of this value will also be passed on to the recognizer. Needs to be a multiple a 100

asr/recognizers/<name>/settings/min_silence_duration

Int

[100 - 10'000]

700

Amount of time (in milliseconds) that silence (non-speech) needs to be detected before triggering the end of the recognition. Needs to be a multiple a 100

asr/recognizers/<name>/settings/padding_size

Int

[0 - 1'000]

450

Amount of perfect silence (in milliseconds) that will be artificially added to the audio at its beginning and its end. This improve performance at almost no cost. Need to rarely be modified.

asr/recognizers/<name>/settings/speech_probability_threshold

Float

]0.0 - 1.0[

0.5

Set the sensibility of the VAD. Lower value mean more prone to false prositive and higher value to false negative

asr/recognizers/<name>/settings/intermediate_result_frequency

Int

0 or [450 - 10'000]

750

Amount of audio (in milliseconds) that needs to be send to the engine before it returns an intermediate result. A value of 0 completely disable intermediate result. Note that this value will only be an aproximation

asr/models

Object

N / A

List here all compiled grammars that will be loaded during run-time

asr/models/<name>

Object

N / A

Specify the name of the model. The name is completely free and will be used in the code to load the appropriate grammar

asr/models/<name>/file

String

Path to the compiled grammar file (.vgg) for this model. If relative, it will be based on the paths/graph path

asr/models/<name>/settings

Object

N / A

Additional settings that will be passed to the model

asr/models/<name>/settings/max_hypothesis

Int

[1 - 10]

3

Set the number of hypothesis that will be returned by the engine for this model

Example

JSON
{
  "paths": {
    "data_root": "../data",
    "acmod": ".",
    "graph": "."
  },
  "log": {
    "vasr": {
      "level": "off"
    },
    "perf": {
      "level": "info",
      "sink": "stdout"
    },
    "recognizer:rec": {
      "sink": "stderr-color"
    },
    "model:cmd": {
      "sink": "file",
      "sink_options": {
        "path": "cmd.log",
        "max_size": 10240,
        "max_file": 5
      }
    }
  },
  "asr": {
    "recognizers": {
      "rec": {
        "acmods": [
          "eng-US.vam"
        ],
        "settings": {
          "min_speech_duration": 500,
          "min_silence_duration": 700,
          "padding_size": 450,
          "speech_probability_threshold": 0.5,
          "intermediate_result_frequency": 0
        }
      }
    },
    "models": {
      "cmd": {
        "file": "eng-US.vgg",
        "settings": {
          "max_hypothesis": 5
        }
      }
    }
  }
}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.