本站文本内容除另有声明外,均在知识共享 署名-非商业性使用-相同方式共享 3.0 协议下提供。(详情…本站文本内容除另有声明外,均在知识共享 署名-非商业性使用-相同方式共享 3.0 协议下提供。(详情…中文Minecraft Wiki是完全公开的。欢迎持续参与翻译工作中文Minecraft Wiki是完全公开的。欢迎持续参与翻译工作Minecraft中文Wiki微博正在更新!或许有兴趣去看看Minecraft中文Wiki微博正在更新!或许有兴趣去看看翻译或创建页面之前,不妨看看译名标准化Wiki条例页面。翻译或创建页面之前,不妨看看译名标准化Wiki条例页面。想与其他用户进行编辑上的沟通?社区专页正是为此创建的。想与其他用户进行编辑上的沟通?社区专页正是为此创建的。需要管理员的协助?在管理员告示板留言也许可以帮到您。需要管理员的协助?在管理员告示板留言也许可以帮到您。

Template:Sound/doc

来自Minecraft Wiki
跳转至: 导航搜索
这是文档页面,它应该被放置到主模板页。查看Template:Documentation以获取更多信息。

This template is used to provide a button to play a sound effect, with a HTML audio player as a fallback if JS is disabled. This is intended primarily for short sound effects, as there is no seeking ability.

The script and styles are provided by the sound gadget (MediaWiki:Gadget-sound.js, MediaWiki:Gadget-sound.css, MediaWiki:Gadget-sound-styles.css), with a fallback style in the site gadget (MediaWiki:Gadget-site-styles.css).

用法[编辑源代码]

  • {{{1}}} is the displayed wikitext. A speaker icon is displayed next to it indicating the playing status. Clicking the text (if not a link) or icon will stop any other sounds, and start/stop this sound.
  • {{{2}}} is the name of the audio file to play
  • {{{nofallback}}} hides the fallback audio player, so the sound can only be played if JS and the sound gadget is enabled. This is good for placing the sound button inline with text, as the fallback audio player is not inline, and would otherwise be too big to include within a sentence. In this case, you should set the displayed text to be a link to the file so it can still be played by no-js users and users which disabled the sound gadget.

示例[编辑源代码]

(Disable the sound gadget to see how the fallback looks)

Basic
{{sound|Play my mixtape 🔥|Calm4.ogg}}

Play my mixtape 🔥


Inline with a link instead of a fallback player
{{sound|'''[[Media:HerobrinePronunciation.ogg|Herobrine]]'''|HerobrinePronunciation.ogg|nofallback=1}} is the subject of a community-made [[wikipedia:Creepypasta|creepypasta]].

Herobrine is the subject of a community-made creepypasta.


In an infobox
{{entity
|sounds=
* {{sound|'''Idle'''|Parrot idle.ogg}}
* {{sound|'''Eat'''|Parrot eat.ogg}}
* {{sound|'''Fly'''|Parrot fly.ogg}}
* {{sound|'''Step'''|Parrot step.ogg}}
* {{sound|'''Hurt'''|Parrot hurt.ogg}}
* {{sound|'''Death'''|Parrot death.ogg}}
}}