Extension:Phonos
![]() Release status: beta |
|
---|---|
Implementation | Tag |
Description | Text to speech parser |
Author(s) | Community Tech Team |
Latest version | 0.1.0 |
Compatibility policy | Master maintains backward compatibility. |
MediaWiki | >= 1.38.0 |
Database changes | No |
License | GNU General Public License 2.0 or later |
Download | README |
Help | Help:Extension:Phonos |
|
|
{{#phonos:}} |
|
Quarterly downloads | 1 (Ranked 178th) |
Translate the Phonos extension if it is available at translatewiki.net | |
Issues | Open tasks · Report a bug |
The Phonos extension is a Community Tech project for implementing the IPA Audio Renderer wish from the 2022 Community Wishlist Survey.
Installation[edit]
- Download and place the file(s) in a directory called
Phonos
in yourextensions/
folder. - Only when installing from Git, run Composer to install PHP dependencies, by issuing
composer install --no-dev
in the extension directory. (See task T173141 for potential complications.) - Add the following code at the bottom of your
LocalSettings.php
:wfLoadExtension( 'Phonos' );
- If you're using the eSpeak or Larnyx engines, you will need to install Lame on your system, and set
$wgPhonosLame
accordingly. Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Configuration parameters[edit]
- $wgPhonosEngine
- Which engine to use. One of
espeak
(default),larynx
, orgoogle
. - $wgPhonosApiEndpointLarynx
- The API endpoint to use for the Larynx engine.
- $wgPhonosApiEndpointGoogle
- The API endpoint to use for the Google engine.
- $wgPhonosApiKeyGoogle
- The API key for the Google engine.
- $wgPhonosApiProxy
- HTTP proxy to use for API requests. If not set, $wgHTTPProxy will be used.
- $wgPhonosFileBackend
- Which file backend to use for caching. Defaults to a custom Phonos backend using FSFileBackend.
- $wgPhonosFileBackendDirectory
- Which directory to use for file caching, if $wgPhonosFileBackend is
false
. Defaults to $wgUploadDirectory. - $wgPhonosEspeak
- Path to the eSpeak executable. Defaults to
/usr/bin/espeak
- $wgPhonosLame
- Path to the Lame executable used for converting WAV to MP3. Defaults to
/usr/bin/lame
- $wgPhonosPath
- Relative URL path to where Phonos files are publicly available. Defaults to
"$wgUploadPath/$wgDBname-phonos"
- $wgPhonosWikibaseUrl
- The URL to a Wikibase installation, including the $wgArticlePath and trailing slash.
- $wgPhonosWikibaseProperties
- An object containing the following:
- wikibasePronunciationAudioProp: Property for pronunciation audio.
- wikibaseLangNameProp: Property for language of work or name.
- wikibaseIETFLangTagProp: Property for IETF language tag.
- $wgPhonosCommonsMediaUrl
- URL to Special:FilePath on a shared media repository including the trailing slash.
- $wgPhonosInlineAudioPlayerMode
- Disables IPA rendering and only allows playing of existing audio from Commons
Usage[edit]
For all usage information, see the extension's help page.
Maintenance[edit]
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:
countOrphanedFiles.php[edit]
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,[1] the script will act only on the current wiki.
deleteOldPhonosFiles.php[edit]
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.
Notes[edit]
- ↑ See Manual:addSite.php and managing the sites table for more information