Development > Engine drivers >


Engine directory

Every engine is located in its own directory. The engine directory contains the engine driver executable, the synthesizer binary libraries and data. It also includes configuration information required by SH.

All engine directories are located under the SpeechHub installation directory in:
sh/engine
In fact installing an engine in SH simply means placing the engine directory under the above directory; when SH is started all engines located in this directory are available.

The contents of its sub-directories are as follows:

sh directory

The sh directory must be included with all engines regardless of the type of interface and communication protocol. It contains the engine.properties file which in turn contains synthesizer information, capabilities and limitations. This information is used by SpeechHub to configure its modules to optimize its use of the synthesizer. The format of the engine.properties file is described in detail in another page in this section.

The sh directory also contains the 'replacement' directory which contains optional replacement text specific to the engine. The detailed structure of the replacement directory is explained further down this page.

stdio directory

The stdio directory and its variants contain the engine driver executable, the synthesizer binary libraries and any other dependencies such as compiler specific libraries. Also, as appropriate, this directory is a good place to put any synthesizer specific copyright information.

This directory naming varies according to the OS and the type of computer used, as follows:

Note that it is possible to write the driver code in any language, but we have implemented these drivers in C for maximum freedom from dependencies outside the engine directory. The examples in this section are all in C.

Note also that this directory is not included with the COM SAPI5 and MSP engine directories as they are included as part of their respected SpeechHub connectors.

synthdata directory

This directory is optional and contains data required by the synthesizer.

The replacement directory in detail

As explained above, the sh/replacement directory contains optional replacement text specific to the engine. A sub-directory named 'all' can be created for common replacement for all languages. Alternatively, directories for specific languages and countries, based on the ISO-639 Language Codes and ISO-3166 Country Codes, can be created. For example 'en' for english or 'en-gb' for English Great Britain. Note that although language codes according to the standard are case insensitive, in SpeechHub language table directories must be defined only in lower case; for example en-gb and not en-GB.

A file called general.txt containing the replacement strings must be present in each of the above directories. This file follows a standard properties file structure. On the left side of an '=' sign, place a string you want replacing. On the right side of the '=' sign, place the replacement string. For example if you want the string 'something' replaced with the string 'something else' then type:
something=something else

The left side of the '=' sign can be a regular expression for more sophisticated replacements. The file can be in utf-8 encoding but, as many text editors do not handle this type of encoding, it might be more convenient to represent Unicode characters outside the basic ASCII range by placing a '\u' prefix before the character code number.

Note that the 'sh/replacement' directory for each engine is copied to the user settings directory the first time SpeechHub is started if it does not exist already. This arrangement ensures that alternative user settings can be specified and retained when the SpeechHub software is updated.


[ Next - Engine properties file ]

[ Previous - Engine interfaces ]

[ Up - Engine drivers - Section ]

[ Up 2 - Development - Section ]

[ Up 3 - SpeechHub - TTS server for the vision impaired community - Main Index ]