Extension:Wikispeech

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

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
Author(s)Template:Extension#username
  • Sebastian Berlin
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download
[ README]
ParametersTemplate:Extension#parameters
  • $wgWikispeechServerUrl
  • $wgWikispeechRemoveTags
  • $wgWikispeechNamespaces
  • $wgWikispeechKeyboardShortcuts
  • $wgWikispeechSkipBackRewindsThreshold
Hooks usedTemplate:Extension#hook
ResourceLoaderTestModulesManual:Hooks/ResourceLoaderTestModules
ParserAfterTidyManual:Hooks/ParserAfterTidy
BeforePageDisplayManual:Hooks/BeforePageDisplay
ResourceLoaderGetConfigVarsManual:Hooks/ResourceLoaderGetConfigVars

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

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

IssuesPhabricator

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.

Download[edit]

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: 0.0.0.0/0
  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: MaryTTS (TTS platform), 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]

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 pronlex
    1. $ cd ~/go/src/github.com/stts-se/pronlex/lexserver/
    2. $ go run *.go
  6. Create new window
  7. 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
WikispeechServerUrl
"https://morf.se/wikispeech/"
The URL for the TTS server to use.
WikispeechRemoveTags
{
    "span": "mw-editsection",
    "table": true,
    "sup": "reference",
    "div": [
        "thumb",
        "toc"
    ]
}
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.
WikispeechNamespaces
[
    "NS_MAIN"
]
List of the namespaces, for which Wikispeech is activated, using constant names.
WikispeechKeyboardShortcuts
{
    "playStop": {
        "key": 32,
        "modifiers": [
            "alt",
            "shift"
        ]
    },
    "skipAheadSentence": {
        "key": 39,
        "modifiers": [
            "alt",
            "shift"
        ]
    },
    "skipBackSentence": {
        "key": 37,
        "modifiers": [
            "alt",
            "shift"
        ]
    },
    "skipAheadWord": {
        "key": 40,
        "modifiers": [
            "alt",
            "shift"
        ]
    },
    "skipBackWord": {
        "key": 38,
        "modifiers": [
            "alt",
            "shift"
        ]
    }
}
Shortcuts for Wikispeech commands. Each shortcut defines the key pressed (as key code[1]) and any modifier keys (ctrl, alt or shift).
WikispeechSkipBackRewindsThreshold
3.0
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.
WikispeechHelpPage
"Help:Wikispeech"
Help page for Wikispeech. If defined, a button that takes the user here is added next to the player buttons.
WikispeechFeedbackPage
"Wikispeech feedback"
Feedback page for Wikispeech. If defined, a button that takes the user here is added next to the player buttons.

CSS[edit]

Selector Default values Documentation
.ext-wikispeech-highlight-sentence
background-color: rgb( 200, 170, 255 );
The visual highlighting for the sentence that is currently being recited.
.ext-wikispeech-highlight-word
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

Troubleshooting[edit]

See also[edit]