From mediawiki.org
This is the documentation for installing and configuring Wikispeech. If you are looking for help on how to use it, see Help:Extension:Wikispeech .
MediaWiki extensions manual
Release status: beta
Implementation Page action , Ajax, API , Special page , Database
Description Reads page text out loud using text-to-speech
Author(s) Sebastian Berlin, André Costa, Karl Wettin and Igor Leturia
Latest version 0.1.10 (2023-03-08)
MediaWiki >= 1.39
Database changes Yes
License GNU General Public License 2.0 or later
Help Help:Extension:Wikispeech
  • $wgWikispeechSkipBackRewindsThreshold
  • $wgWikispeechSpeechoidUrl
  • $wgWikispeechSpeechoidHaproxyFrontendSvName
  • $wgWikispeechSpeechoidHaproxyOverloadFactor
  • $wgWikispeechRemoveTags
  • $wgWikispeechFeedbackPage
  • $wgWikispeechSpeechoidHaproxyStatsUrl
  • $wgWikispeechSymbolSetUrl
  • $wgWikispeechListenMetricsJournalFile
  • $wgWikispeechMinimumMinutesBetweenFlushExpiredUtterancesJobs
  • $wgWikispeechUtteranceFileBackendContainerName
  • $wgWikispeechKeyboardShortcuts
  • $wgWikispeechPronunciationLexiconConfiguration
  • $wgWikispeechSpeechoidResponseTimeoutSeconds
  • $wgWikispeechSpeechoidHaproxyFrontendPxName
  • $wgWikispeechUtteranceUseSwiftFileBackendExpiring
  • $wgWikispeechSpeechoidHaproxyQueueUrl
  • $wgWikispeechUtteranceFileBackendName
  • $wgWikispeechSpeechoidHaproxyBackendSvName
  • $wgWikispeechContentSelector
  • $wgWikispeechListenDoJournalMetrics
  • $wgWikispeechVoices
  • $wgWikispeechSpeechoidHaproxyBackendPxName
  • $wgWikispeechUtteranceTimeToLiveDays
  • $wgWikispeechProducerMode
  • $wgWikispeechHelpPage
  • $wgWikispeechNamespaces
  • $wgWikispeechListenMaximumInputCharacters
  • $wgWikispeechSegmentBreakingTags
  • wikispeech-listen
  • wikispeech-read-lexicon
  • wikispeech-edit-lexicon
Quarterly downloads 21 (Ranked 157th)
Translate the Wikispeech extension if it is available at translatewiki.net
Vagrant role wikispeech
Issues Open tasks · Report a bug

The Wikispeech project aims to create an open source text-to-speech tool to make Wikimedia's projects more accessible for people that have difficulties reading for different reasons. Wikispeech will be available as a MediaWiki extension. More information can be found on the project page; this page is just about the Wikispeech extension itself.


Diagram over some typical interaction between the components in Wikispeech.


Installation instructions

The extension uses a service for TTS operations, such as creating audio for utterances called Speechoid. Speechoid consists of a main server, a lexicon server, TTS engines and any additional components that may be required for certain languages.

To prepare an utterance for playing, the extension sends a request to the service. This request contains the utterance as text, which language it is in and which voice to use. The service processes the text using a lexicon and one of the installed TTS engines, depending on what voice is being used. Once the audio has been generated, a response is returned with audio data along with some information that will enable highlighting and skipping. This is then used by the extension to actually play the utterance to the user and the process is repeated for the following utterances as needed.

Main Wikispeech Server[edit]


The main server has a web API that includes an endpoint for generating speech. It handles internal communication between the underlying servers, listed below.



A lexicon server with its own API. Holds information about lexicon entries and has endpoints for lookup and manipulation of them. When processing an utterance, words are looked up in the lexicon and if there is a matching entry it is used for the pronunciation.

TTS engines[edit]

The server supports having multiple TTS engines. Which one is used for a certain utterance depends on which voice is given in the request.



Comes with support for Arabic, English and Swedish.

Additional Components[edit]



Used to vocalize Arabic text.



Symbolset is a repository for handling phonetic symbol sets and mappers/converters between different symbol sets and languages.


  • Download and place the file(s) in a directory called Wikispeech in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php :
    wfLoadExtension( 'Wikispeech' );
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Setting up Speechoid[edit]

The Wikispeech extension requires Speechoid to generate audio. Detailed instructions for installing Speechoid can be found on Installing Speechoid.

Basic configuration[edit]

For the Wikispeech extension to be able to communicate with Speechoid, you need to specify the service's URL. You can do this by adding the following line to LocalSettings.php :

$wgWikispeechSpeechoidUrl = 'URL';

where URL is the URL to your Speechoid instance.

Running as producer[edit]

If you want use your wiki to enable Wikispeech on other wikis you can enable "producer mode". One use case for this is to run Wikispeech as a gadget on other wikis.

Normally Wikispeech gets the text to synthesise from pages on the wiki it's installed on. If WikispeechProducerMode is true the wikispeech-listen action can take the parameter consumer-url. consumer-url should be set to the script path of the consumer wiki, e.g. for this wiki https://www.mediawiki.org/w. When the request is made Wikispeech will get the content from the consumer wiki and synthesise as normal. The utterance is stored with the extra parameter wsu_remote_wiki_hash in the database to keep track of which wiki it was generated from.

To enable Wikispeech with a gadget or user script see Help:Extension:Wikispeech#As gadget or user script.

Complete list of configuration options[edit]

Option Default value Documentation
The URL to use for the Speechoid service.
The URL to use for the Symbol set service.
Default number of seconds to await an HTTP response from Speechoid. Falsy value defaults to MediaWiki default.
Maximum number of characters in the input (a segment) sent to the Speechoid service.
    "span": "mw-editsection",
    "table": true,
    "sup": "reference",
    "div": [
Map of HTML tags that should be removed completely, i.e. including any content. Keys are tag names and the values determine whether a tag should be removed, as follows:
  • If true, remove all tags of that type.
  • If an array, remove tags whose class matches any of the strings in the array.
  • If false, tags of that type will not be removed. This can be used in "LocalSettings.php" to override default criteria.
HTML tags that will break text in segments. This ensure that, for example a header text without punctuation suffix will not be merged to the same segment as the text content of a preceding paragraph.
List of the namespace indices, for which Wikispeech is activated.
    "playStop": {
        "key": 13,
        "modifiers": [
    "skipAheadSentence": {
        "key": 39,
        "modifiers": [
    "skipBackSentence": {
        "key": 37,
        "modifiers": [
    "skipAheadWord": {
        "key": 40,
        "modifiers": [
    "skipBackWord": {
        "key": 38,
        "modifiers": [
Shortcuts for Wikispeech commands. Each shortcut defines the key pressed (as key code[1]) and any modifier keys (ctrl, alt or shift).
If an utterance has played longer than this (in seconds), skipping back will rewind to the start of the current utterance, instead of skipping to previous utterance.
Help page for Wikispeech. If defined, a button that takes the user here is added next to the player buttons.
"Wikispeech feedback"
Feedback page for Wikispeech. If defined, a button that takes the user here is added next to the player buttons.
The selector for the element that contains the text of the page. Used internally, but may change with MediaWiki version.
    "ar": [
    "en": [
    "sv": [
Registered voices per language. System default voice falls back on the first registered voice for a language if not defined by Speechoid.
Minimum number of minutes between queuing jobs that automatically flushes expired utterances from the utterance store. The job will be queued during creation of a new utterance, given that enough minutes has passed since the previous queuing of the job. Disable automatic flushing by setting value to a falsy value (0, false, null, etc). To avoid running the flush job too often, see the MW job documentation.
Minimum number of days for an utterance to live before being automatically flushed from the utterance store. More or less the cache flush setting for synthesized text. Setting this value too low will save disk space but cause frequently requested text segments to be re-synthesized more often with a CPU cost. Setting this value too high will block improvements to the voice synthesis. Setting this value to 0 will in effect turn off the cache and thus flush all utterances as soon as possible.
FileBackend group defined in LocalSettings.php used for utterance audio and metadata files. If not defined in LocalSettings.php, a FSBackend will be created that work against a temporary directory. See log warnings for exact path.
Container name used in FileBackend for utterance audio and metadata files.
In case of the file backend is Swift and this value is set true,the Wikispeech will set the 'X-Delete-After' header when creating files in Swift and the utterance flushing mechanism will not invoke delete command in Swift. I.e. the actual flushing of utterances is moved to the Swift layer. In order for this to make sense, the Swift file backend must be set to accept these headers. For more information on how to do this see https://docs.openstack.org/swift/latest/overview_expiring_objects.html. This feature will be officially supported by Wikispeech as of the first LTS release of MediaWiki after 1.35 (i.e. probably 1.39).
Controls how the pronunciation lexicon is persisted and accessed. 'Speechoid' must be a part of the chain in order to make an impact to the speech synthesis. Possible values are: 'Speechoid', access only the underlying lexicon in Speechoid. No revision history. 'Wiki+Speechoid', access the lexicon stored as articles in NS_PRONUNCIATION_LEXICON for revision history and passed down to Speechoid. 'Wiki', access only the lexicon stored as articles in NS_PRONUNCIATION_LEXICON. 'Cache', transient storage in MediaWiki WAN cache. For development only. 'Cache+Speechoid', transient storage in WAN cache, passed down to Speechoid. For development only.
Run Wikispeech in producer mode. This allows other wikis (consumers) to use this wiki to generate utterances. When an API requests includes the parameter `consumer-url`, page content is retrieved from the consumer wiki on that URL.


This is a subset of the CSS rules that are most interesting for a non-developer.

Selector Default values Documentation
background-color: rgb( 200, 170, 255 );
The visual highlighting for the sentence that is currently being recited.
background-color: rgb( 255, 200, 140 );
The visual highlighting for the word that is currently being recited.