Skip to main content

Basic configuration

The default SPE configuration is defined in the file {spe_root}/settings/phxspe.properties. This file is automatically created after running the phxadmin utility for the first time, which is usually used for initial configuration of the system. Alternatively, it can be found in {spe_root}/data/phxspe.properties.template, from which the actual configuration file may be populated and renamed manually. The format of the configuration file is text-based, well commented and human-readable.

Read carefully these comments, as there are some useful tips. Pay attention to the comment about variables notation format mentioned in the configuration preamble:

# This is the default properties file for Phonexia Speech Engine
#
# Variables:
# ${application.dir} path to application directory
# ${system.env.<NAME>} system environment variable
#
# Property values containing backslash (\), for example Windows paths must be
# escaped with double slash (C:\\spe). It is also possible to use slash (/) in
# Windows path (C:/spe).

The following section describes standard network configuration and logging details. Administrators should know what to do, but we recommend setting the log verbosity to debug during the first run, as it helps in troubleshooting. Once the system is configured and declared as stable, information log level will be sufficient. If you prefer saving log information into a database instead of a file, see the Database configuration page before changing the directive server.logging.destination = database.

# IP address and port for server listening
server.bind_ip = 0.0.0.0
server.port = 8600
# Server logging
# Level (trace, debug, information, warning, error, fatal)
server.logging.level = information
# Destination (console, file, database)
# Logging to database is supported only for MySQL
server.logging.destination = file
# Path to file where log is stored
server.logging.file = ${application.dir}log/phxspe.log

Did you notice the server.logging.file directive? It provides the first example of using variables in the configuration. You can easily use this feature to create custom log names when you collect logs from multiple servers or instances, for example, this directive:

server.logging.file = ${system.env.HOME}/log/${system.env.HOSTNAME}_phxspe.log

will, in my case, create the log file in /home/petrv/log/erebos_phxspe.log, because in my system environment, the HOME directory corresponds to "/home/petrv" and my HOSTNAME is "erebos" .

warning

Please double-check user privileges in the target directory or file if the SPE instance is running under different user context.

Even though this example is for Linux-based systems, the same principle applies in a Windows environment.

# Log file rotation based on log file size or time intervals
# Supported values:
# never no log rotation (default)
# [day,\]\[hh\]:mm the file is rotated on specified day/time day - day is specified
# as long or short day name (Monday|Mon, Tuesday|Tue, ... ) day can be omitted,
# in which case log is rotated every day hh - valid hour range is 00-23;
# hour can be omitted, in which case log is rotated every hour mm - valid minute range is 00-59; minute must be specified
# daily the file is rotated daily
# weekly the file is rotated every seven days
# monthly the file is rotated every 30 days
# <n> minutes the file is rotated every <n> minutes, where <n> is an integer greater than zero.
# <n> hours the file is rotated every <n> hours, where <n> is an integer greater than zero.
# <n> days the file is rotated every <n> days, where <n> is an integer greater than zero.
# <n> weeks the file is rotated every <n> weeks, where <n> is an integer greater than zero.
# <n> months the file is rotated every <n> months, where <n> is an integer greater than zero and a month has 30 days.
# <n> the file is rotated when its size exceeds <n> bytes.
# <n> K the file is rotated when its size exceeds <n> Kilobytes.
# <n> M the file is rotated when its size exceeds <n> Megabytes.
# Rotation strategy is based on UTC time
#
server.logging.file.rotation = daily

# The value specifies the maximum number of archived log files. If the number is exceeded,
# archived log files are deleted, starting with the oldest.
#
server.logging.file.purge_count = 5

The following directive is primarily important for tuning and initializing the SPE. Enable it when the system is ready to go live.

# Use separate thread for logging. It may increase speed of logging but in case of server crash or if server is killed,
# some logs may be lost. Default is false.
server.logging.enable_async = false

# Name of server used in log. If it is not specified hostname is used instead.
# server.logging.database.identifier = spe

# Set set umask value for server (Linux only)
# server.umask = 0022

Data storage and multithread settings

The home directory of SPE contains all user data, including audio recordings and metadata files from speech processing (such as speaker models and description). This is another good example of using environment variables if your topology design requires multiple instances of SPE processing the same payload. This setup is ideal for sharing raw data between multiple physical servers using network-based storage and network shares.

# Home directory path. To this folder are stored all the data of all users.
server.user.home = ${application.dir}home

Enabling server.technology_multithread_initialization = true significantly improves the initialization of the SPE after a restart.

note

Set it to false during troubleshooting, as multi-thread initialization can mix the output printed in the log file, making it difficult to determine which thread caused an issue.

# Set multi-thread technology initialization
# When enabled server use multiple thread to speed up initialization of technologies
server.technology_multithread_initialization = false

# Number of threads for initialization of technologies
# Use 0 for automatic detection
server.technology_multithread_initialization.n_threads = 0

Enable automatic audio format conversion

Phonexia technologies and SPE directly support audio formats and codecs originally developed for speech recordings. Other formats can be converted for use with the SPE using third-party tools. The settings below determine which native codecs will be enabled and how the SPE should handle other audio formats.

# Enable or disable native support for OPUS audio format (Default: true)
# When disabled, audio file will be converted to WAV
server.audio_formats.opus.enabled = true
# Enable or disable native support for FLAC audio format (Default: true)
server.audio_formats.flac.enabled = true
# Enable or disable audio converter
audio_converter.enabled = true
# Set converter command
# %1 is for input file
# %2 is for output file
# ffmpeg example:
# audio_converter.command = ffmpeg -loglevel warning -y -i %1 %2
# sox example:
# audio_converter.command = sox %1 %2
audio_converter.command = ffmpeg -loglevel warning -y -i %1 %2