NVSClientInitFromFile
Initializes the Vocalizer client while supplying the location of a file that lists values for the mandatory (and optional) configuration parameters. The format for the function is:
TTSRETVAL NvsClientInit(const_char* szUserCfgFile);
This function can be used only once, at application startup. It is mutually exclusive with NVSClientInit().
Argument |
Description |
---|---|
szUserCfgFile |
The full path (included filename) of the configuration file that contains all the mandatory (and optional) parameters that are required to configure the Vocalizer client. |
pnVersion |
A pointer to a variable that receives the NVS protocol version. Can be set to NULL. |
This function or NVSClientInit must be used before the TtsSystemInit function.
File format
The configuration file is a simple text file that begins with an [nvs-client] heading, and lists each parameter on a separate line:
[nvs-client]
server.nvs.Address = localhost:9200
server.nvs-client.Port = 9300
server.nvs.ConnectionTimeout = 5000
To disable a parameter, put "#" sign at the beginning of the row to comment it out:
#server.nvs-client.LogPath = /tmp/nvsclient.log
Vocalizer client parameters
The configuration parameters that may appear in the file are the following:
Parameter |
Default value |
Description |
---|---|---|
server.nvs.Address |
127.0.0.1:9200 |
Specifies the locations of the Vocalizer host the Vocalizer plugin communicates with. |
server.nvs-client.Port |
9300 |
Specifies the port where Vocalizer client connects to the callback channel. |
server.nvs.ConnectionTimeout |
5000 |
Specifies the timeout value (in milliseconds) for connecting (or re-connecting) Vocalizer plugin to Vocalizer host. After this timeout expires, resource allocation fails and Vocalizer returns negative value into MRCP resource negotiation. |
server.nvs-client.LogPath |
[no default] |
This is the base log path where diagnostic log file(s) are to be written. If this parameter is not present, no log file is written. When a log file reaches the server.nvs-client.LogMaxSize size, the file is stored in the same folder with a suffix –BCKXX (before file extension, to preserve readability) where XX is a number from 00 to 09. This means that up to 10 backup files may be present on the disk at a given time. The software cycles sequentially through the 10 available log files, overwriting the oldest backup if necessary. For example, if the log file is named log.txt and files log-BCK00.txt to log-BCK09.txt have already been created, then when the current log.txt reaches the size limit, it overwrites the backup log-BCK00.txt. When the next log.txt reaches the maximum size, it overwrites log-BCK01.txt, and so on until it cycles through to log-BCK00.txt again. Note: If you have multiple instances of the client, you need to specify different values for this path when specifying it as a parameter of the NVSClientInit() or NVSClientInitFromFile() API function calls. |
server.nvs-client.LogMaxSize |
500 |
This is the maximum size (in MB) allowed for each log file. When this size is reached, the file is rolled over into the next available file. |
server.nvs-client.LogLevel |
0 |
This is the log level desired for diagnostic log file(s). Permitted values are 0, 1, or 2:
|
Related topics
Related APIs