Release status: beta
|Description||Text to speech parser|
|Author(s)||Community Tech Team|
|Compatibility policy||Master maintains backward compatibility.|
|License||GNU General Public License 2.0 or later|
|Quarterly downloads||23 (Ranked 140th)|
|Translate the Phonos extension if it is available at translatewiki.net|
|Issues||Open tasks · Report a bug|
- Download and place the file(s) in a directory called
- Only when installing from Git, run Composer to install PHP dependencies, by issuing
composer install --no-devin the extension directory. (See task T173141 for potential complications.)
- Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'Phonos' );
- If you're using the eSpeak or Larnyx engines, you will need to install Lame on your system, and set
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Configuration parameters edit
- Which engine to use. One of
- The API endpoint to use for the Larynx engine.
- The API endpoint to use for the Google engine.
- The API key for the Google engine.
- HTTP proxy to use for API requests. If not set, $wgHTTPProxy will be used.
- Which file backend to use for caching. Defaults to a custom Phonos backend using FSFileBackend.
- Which directory to use for file caching, if $wgPhonosFileBackend is
false. Defaults to $wgUploadDirectory.
- Path to the eSpeak executable. Defaults to
- Path to the Lame executable used for converting WAV to MP3. Defaults to
- Relative URL path to where Phonos files are publicly available. Defaults to
- The URL to a Wikibase installation, including the $wgArticlePath and trailing slash.
- An object containing the following:
- wikibasePronunciationAudioProp: Property for pronunciation audio.
- wikibaseLangNameProp: Property for language of work or name.
- wikibaseIETFLangTagProp: Property for IETF language tag.
- URL to Special:FilePath on a shared media repository including the trailing slash.
- Disables IPA rendering and only allows playing of existing audio from Commons
For all usage information, see the extension's help page.
Phonos does not automatically delete files that have become orphaned. Over time, these files can build up and needlessly occupy space on your file system. To assist with this problem, Phonos offers two maintenance scripts:
This script will count orphaned files. You can pass the
--delete flag to also delete the files.
On wiki farms you can use the
--wikis flag to specify which wikis to process, passing in the global IDs (database names). If not provided, the script will loop through all wikis as specified in the sites table, and process any where Phonos is installed. If the sites table is not populated, the script will act only on the current wiki.
This script will delete all Phonos files created before the date specified with the
--date option. This is useful if you for instance changed the engine, and want to force recreation of Phonos files.
Adding a new TTS engine to Phonos edit
Phonos was designed to be agnostic to the engine used. The only requirement for TTS engines is that they accept SSML.
Create a new subclass of
Engine and implement the required methods. Note that
null by default. If there is a way to programmatically fetch (or even hard code) the list of languages, this method should be overridden in the new subclass.
If the engine doesn't produce output in MP3 format, then Lame should be used to convert the file to MP3, such that
getAudioData() returns only raw MP3 data. That method should also be responsible for persisting the file to disk using
Metrics and instrumentation edit
The click and replay events are logged by
PhonosButton.prototype.track(), which can be used to track more things as desired. See phab:T315091 for more details.
On the backend, anything that throws a
PhonosException during processing will be captured and recorded on the above dashboards. The responsible pages are also categorized in the category "Pages with Phonos rendering errors", as specified by the MediaWiki:Phonos-error-category interface page.
|This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page.|