Help:Extension:Wikispeech/zh
| 注意:当您编辑本页面时,即同意以CC0协议授权您的贡献。您可以在公有领域帮助页面找到更多信息。 |
Wikispeech is an extension for MediaWiki that reads the content of a page out loud. It is still under development and features will change and be added.
Activating
If Wikispeech is enabled on a wiki, you may still need to activate it to show the interface and start listening. To do this, click on the tab "Listen" (or equivalent for the language in question). You can hide the interface again by clicking on the same tab. You can also choose to show the interface automatically in your preferences.
As gadget or user script
If Wikispeech is not installed on your wiki, it may still be possible to run it as a gadget or user script. This relies on there being another wiki that runs Wikispeech and allows other wikis to use it. If there is such a wiki available, an administrator can add a gadget that enables Wikispeech or you can add a bit of code to your user script. There is a template for the script in the Wikispeech repository.[1] Then to enable the gadget:
- Go to your common.js, e.g for English Wikipedia go to en:Special:MyPage/common.js.
- Click "Edit source" or "Create source".
- Copy and paste the following text to the bottom of the page:
importScript('m:User:Sebastian Berlin (WMSE)/js/wikispeech.js'); - Click "Publish changes".
介面
The player can be found at the bottom of the page and looks like the picture below. With the player, you can start and stop listening to the text. You can also navigate by skipping back and forward in the text.

Here follows a description of what each button does. The shortcuts are the defaults and may be different on your wiki.
- Play Alt+⇧ Shift+↵ Enter
- Starts playing from the top of the page. Changes the button to Pause. Your web browser may not allow playback to start, since this is regarded as autoplay. To start playing, either allow audio autoplay for the site or interact with the page, e.g. by clicking somewhere.
- Pause Alt+⇧ Shift+↵ Enter
- Pauses playback and resumes from the same point when started again. Changes the button to Play.
- Stop Alt+⇧ Shift+← Backspace
- Stops playing.
- Skip back one sentence Alt+⇧ Shift+←
- Starts playing the previous sentence. If the current sentence has played for more than three seconds (default duration, may vary depending on configuration), rewinds to the start of the sentence instead.
- Skip back one word Alt+⇧ Shift+↑
- Rewinds to the previous word.
- Skip forward one word Alt+⇧ Shift+↓
- Fast forward to the next word.
- Skip forward one sentence Alt+⇧ Shift+→
- Starts playing the next sentence.
The following buttons may not appear, depending on configuration.
- Help
- Go to the help page.
- Feedback
- Opens a popup for leaving feedback.
- Edit lexicon
- Go to the page for editing the lexicon. See Edit lexicon.
- Settings
- Opens a popup to change personal preferences such as speech rate, voice, language and more.
Selection Player

When you select text in the page, a smaller selection player will show up at the end of the selection. You can still use the regular player and the keyboard shortcuts to control the playback.
When you click anywhere in the text in the page the focus player will also appear. Playback will then start from that point. It's not possible to show the focus player this way if playback is ongoing. In that situation stop the playback first. When you click X, both the focus and selection player will disappear.
Settings
Highlighting

To customize the highlighting, the user can turn on and off the setting for highlighting (default setting is on). If on, a user can choose between what colors they want for sentence and words.
The colors we have now could change, if the target audience request it.
Read extra information for certain elements
When an element on a page has more information than just text this will be announced. For instance a link, list or an image. The content of the announcement depends on the type of element and what information is available for it.
Edit lexicon
If you have access to Special:EditLexicon, you can edit a word’s transcription – that is, its pronunciation according to the IPA. The form consists of the following steps:
- In the first step, enter the word you want to edit
- If the word already exists in the lexicon, you can either create a new entry or select an existing one to edit by choosing an ID from the drop-down menu.
- In the final step, you specify the word’s transcription (i.e. its phonetic pronunciation). To listen to the transcription you entered, click the Preview button.
For in depth instructions, see Help:Extension:Wikispeech/Lexicon editor.
Known limitations
Sometimes there may be delays when a new sentence is read. This is in part due to not wanting to load too much audio before knowing if the user wants to listen to it; this would be unnecessary taxing, both for the server and the user's network. There are some plans for mitigating this, including smarter buffering.
Some things aren't read, like images and tables. This is because it's not obvious how these should be read, e.g. in what order should the cells in a table be read?
There is no way to start listening from anywhere but start of the page. This is functionality that we have not yet had time to implement, but something we plan to do since it would make listening more user friendly.
Wikispeech does not work in the standard mobile view. This is because it behaves differently than the desktop view. Until support is added for the mobile view, you can switch to the desktop view on your mobile to use Wikispeech. A link for this can be found at the bottom of every page.
