From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.svg

Release status:Extension status beta

Wikispeech logo.svg
ImplementationTemplate:Extension#type other (invalid type)
DescriptionTemplate:Extension#description Integrates Wikispeech into MediaWiki for text-to-speech functionality
  • Sebastian Berlin
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
  • $wgWikispeechServerUrl
  • $wgWikispeechRemoveTags
  • $wgWikispeechNamespaces
  • $wgWikispeechKeyboardShortcuts
  • $wgWikispeechSkipBackRewindsThreshold
Hooks usedTemplate:Extension#hook

Translate the Wikispeech extension if it is available at translatewiki.net

Check usage and version matrix.
Vagrant roleMediaWiki-Vagrant#Using roles wikispeech


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. Stable release is planned for 2017.

User guide[edit]

See Help:Extension:Wikispeech.


For the General User:

For the Advanced User:

Setting up Wikispeech[edit]

These are the instructions to install the TTS server on wmflabs.org.

Creating an instance[edit]

Follow instructions on https://wikitech.wikimedia.org/wiki/Help:Instances#Creating_an_instance:

  1. Log in to https://horizon.wikimedia.org and go to the wikispeech project (in top bar).
  2. ComputeOverview and check that there are instances available.
  3. Create a Security Group:
    • ComputeAccess & SecurityCreate Security Group; Name: TTS-provider
      • Manage RulesAdd Rule; Port: 10000, Remote: CIDR, CIDR:
  4. Open Launch Instance dialogue (ComputeInstancesLaunch Instance):
    1. Details: only set Instance Name: wikispeech-tts
    2. Source: Select boot source: Image, under Available: add debian-9.1-stretch
    3. Flavor: Under Available: add m1.medium (marytts uses ~ 1.1 GB on local machine)
    4. Security Groups: Under Available: add default, TTS-provider, web-server
  5. Make services accessible through proxy, DNSWeb proxiesCreate proxy
    1. Hostname: wikispeech-tts, Backend instance: wikispeech-tts, Backend port: 10000
    2. Hostname: wikispeech-tts-audio, Backend Instance: wikispeech-tts, Backend port: 80

To ssh to the new instance, see: https://wikitech.wikimedia.org/wiki/Help:Getting_Started#Project_Instances

Install TTS server[edit]

The TTS server consists of three components: The TTS platforms (there can be many of them, each for a variety of languages: MaryTTS, AhoTTS...), pronlex (a pronunciation lexicon database) and wikispeech_mockup (wikispeech API). Installation instructions can be found at http://stts-se.github.io/wikispeech/.

Start processes in screen[edit]

As of v0.3.0beta4 this is no longer needed; the components are started using a script.

This can be helpful while developing/experimenting.

As user tts-agent:

  1. $ script /dev/null, needed to get screen running (http://serverfault.com/a/116830)
  2. $ screen
  3. Start MaryTTS
    1. $ cd ~/marytts-installer/
    2. $ ./marytts
  4. Create new window: Ctrl+a, c
  5. Start AhoTTS
    1. $ cd ~/AhoTTS-eu-Wikispeech/
    2. $ bin/tts_server -IP= -Port=1200
  6. Create new window
  7. Start pronlex
    1. $ cd ~/go/src/github.com/stts-se/pronlex/lexserver/
    2. $ go run *.go
  8. Create new window
  9. Start wikispeech.py
    1. $ cd ~/wikispeech_mockup/
    2. $ python3 wikispeech.py

You can now detach the screen Ctrl+a, d and resume with $ screen -r. Note that $ script /dev/null is required to run screen each time you become tts-agent.

Basic configuration for MediaWiki-Wikispeech[edit]

Complete list of configuration options[edit]

Option Default value Documentation
The URL for the TTS server to use.
    "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 LocalSetting.php to override default criteria.
List of the namespace indices, for which Wikispeech is activated.
    "playStop": {
        "key": 32,
        "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.


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.

Setting Wikispeech up on shared hosting[edit]

See Extension:Wikispeech/Installation on a shared host


See also[edit]