Skip to content Skip to main navigation Skip to footer

Understand SPE executable files

This article explains the purpose and usage of executables distributed in SPE package: phxspe, phxclient, phxadmin and phxadmin2.

phxspe

phxspe is the main SPE executable, launching this file starts the SPE itself.

Command line parameters supported by phxspe are listed below:
(use appropriate OS-specific parameter separator, e.g. use --help in Linux and /help in Windows)

Generic

help – Show help information on command line parameters and exit
version – Show version and exit
config=<file> – Use specified SPE configuration file
license=<file> – Use specified license file
cwd=<directory> – Set current working directory before launching SPE
terminate-by-stdin – Terminate server by entering q character

Linux-specific

daemon – Run SPE in background as daemon
umask=<mask> – Set the “umask” value for daemon (in octal format, e.g. 027)
pidfile=<path> – Write the application’s process ID (PID) to the specified file

Windows-specific

registerService – Register the application as Windows service
displayName=<text> – Specify service friendly name (valid only with registerService)
description=<text> – Specify service description (valid only with registerService)
startup=automatic|manual – Specify service startup mode (valid only with registerService)
unregisterService – Unregister the previously registered Windows service


phxclient

phxclient is simple command line SPE client. It is specifically designed for the SPE REST API, e.g. it automatically handles polling for asynchronous requests results. phxclient also provides additional functionality related to SPE features, like ability to stream audio recordings via RTP or HTTP stream. Therefore it’s useful for quick testing of the SPE API without complex scripting or programming.

Command line parameters supported by phxclient are listed below:
(use appropriate OS-specific parameter separator, e.g. use --help in Linux and /help in Windows)

help – Show help information on command line parameters and exit
verbose – Use verbose output
method=<name> – Set HTTP method (GET, POST, DELETE, etc.)
uri=<uri> – Set URI for the HTTP request
login=<username> – Set user name for HTTP Basic authentication
password=<password> – Set user password for HTTP Basic authentication
session=<session> – Set session ID for authentication
data=<file> – Path to file to be sent (usually via POST or PUT)
content-type=<content_type> – Set Content-Type for data to be sent (e.g. “application/json”)
chunked – Send data using HTTP chunked transfer encoding
rtp=<host>:<port> – Send data using RTP stream to specified “host” and “port”
rtp-payload=<payload> – Set RTP payload type. Supported payloads are 0, 8, 10, 11, 35, 36 (see API documentation for more details). Payload has to correspond with data in file (set by “data” parameter). If omitted, default payload type 11 is used.
webhook=<url> – Use Webhook to deliver asynchronous request result to URL (e.g. “http://server:port”)
priority=number – Set request priority (see Understanding SPE processing priority for more details)

phxclient: example 1

phxclient /login=admin /password=phonexia /method=POST /uri="127.0.0.1:8600/audiofile?path=/myfile.wav" /data="c:\audio files\example recording.wav"

Upload example recording.wav file from c:\audio files folder to SPE running at this machine (i.e. with IP address 127.0.0.1) and put it in the root of SPE internal storage under myfile.wav name.
See POST /audiofile endpoint documentation for details.

phxclient: example 2

phxclient /login=admin /password=phonexia /method=GET /uri="127.0.0.1:8600/technologies/stt/?path=/myfile.wav&model=en_us_6&result_type=one_best,n_best&cache_disable=true"
./phxclient --login=admin --password=phonexia --method=GET --uri="127.0.0.1:8600/technologies/stt/?path=/myfile.wav&model=en_us_6&result_type=one_best,n_best&cache_disable=true"

Process myfile.wav file stored in the root of SPE internal storage – e.g. uploaded using the previous example – using the Speech To Text (STT) technology model EN_US_6 (6th generation English), returning one_best and n_best result types, and disabling any possibly previously cached results (i.e. ensuring physical processing of the file). See GET /technologies/stt endpoint documentation for details.


phxadmin

phxadmin is interactive command line based SPE administration utility for user management, technologies configuration, diagnostic info collection, etc. Due to its interactivity it’s not really suitable for automation… the phxadmin2 is scripting-friendly tool intended for automated administration.

Command line parameters supported by phxadmin are listed below:
(use appropriate OS-specific parameter separator, e.g. use --help in Linux and /help in Windows)

Generic

help – Show help information on command line parameters and exit
version – Show version and exit
config=<file> – Use specified SPE configuration file
license=<file> – Use specified license file

User management

add-user – Create new user account
edit-user – Edit existing user account
delete-user – Remove existing user account
show-user – Show information about existing user account
list-users – List all existing user accounts

Technologies configuration

configure-tech – Run technologies configuration wizard, which creates technologies configuration file
available-tech=<file> – Create technologies configuration file containing ALL available technologies and technology models. File extension determines resulting file format (XML or JSON).
add-language-pack=<path> – Add custom LID language pack from specified directory. Language pack name will be same as dirctory name.
delete-language-pack – Delete custom LID language pack

Support

hwgen[=<file>] – Create machine HW profile file
report – Create SPE report useful for troubleshooting and diagnostics. Report contains configuration, logs, licences and hardware profile of current computer.

Migration from legacy version

upgrade – Transfer data from REST SERVER v2 to Speech Engine v3. Requires also v2-properties and v2-cwd parameters.
v2-properties=<file> – Path to REST SERVER v2 bsapirest.properties configuration file
v2-cwd=<path> – Path to REST SERVER v2 working directory. Usually a path to REST SERVER v2 bin directory.


phxadmin2

phxadmin2 is automation- and scripting-friendly command line based SPE administration utility for user management, technologies configuration, diagnostic info collection, etc.

Usage: phxadmin [OPTION | COMMAND] [subcommand] [suboption...]

Options
--help – Show help information on command line parameters and exit
--version – Show SPE version and exit

Commands
user – Manage SPE users. Without sub-command, lists all users.
technology – Manage technologies. Without sub-command, lists enabled technologies.
language-pack – Manage LID language packs. Without sub-command, lists all LID language packs
hwgen – Create machine HW profile file
report – Create SPE report useful for troubleshooting and diagnostics.

Run phxadmin2 COMMAND --help to see available subcommands and additional usage details.

NOTE: phxadmin2 uses internal codes for technology names, see Understand SPE technologies configuration file article for list of technology codes and names.

phxadmin2: example 1

./phxadmin2 hwgen SPE-007 --output-file ~/spe007_profile.txt

Create HW profile named SPE-007 and save it to spe007_profile.txt file to home directory.

phxadmin2: example 2

./phxadmin2 technology show sid4? *l*

List all present technologies with names matching “sid4 followed by any single charater” pattern and models with names matching “l preceded and followed by zero or more characters” pattern.
This command lists SID4E and SID4C (SID4 extractor and SID4 comparator) with both L4 and XL4 models, depending on actual availability of the technologies/models in that SPE installation. Due to the “single character” pattern definition, the list won’t include SID4E_STREAM, SID4C_STREAM and SID4CALIB technologies.

phxadmin2: example 3

./phxadmin2 technology enable sid?_stream:*l?=3 sid4?_stream:*l?=1
  • enable 3 instances of technologies with names matching “sid followed by single character, followed by _stream” pattern and models with names matching “l preceded by any number of characters and followed by any single character
  • and also enable 1 instance of technologies with names matching “sid4 followed by single character, followed by _stream” pattern and models with names matching “l preceded by any number of characters and followed by any single character

Asssuming that all the technologies/models are available in that SPE installation, this command adds(*) the following to the technologies configuration file:
SIDE_STREAM for both L3 and XL3 model, 3 instances of each
SIDC_STREAM for both L3 and XL3 model, 3 instances of each
SID4E_STREAM for both L4 and XL4 model, 1 instance of each
SID4C_STREAM for both L4 and XL4 model, 1 instance of each
(*) Any existing entries in the technologies configuration file are retained (since no --disable-others option was not included in the command).

Related Articles