Template:Sound

From Mo' Creatures Wiki
Jump to: navigation, search

{{{1}}}[[File:{{{2}}}|class=sound-audio]]{{#while:

 | 
 | [[File:{{{ 3 }}}|class=sound-audio]]

}}

[view | edit | history | purge]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).

Usage[edit source]

  • {{{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.
  • {{{3}}}, {{{4}}} and additional unnamed parameters specify additional audio files and display additional speaker icons. The fallback audio player will not show for these additional files, in order to prevent infoboxes from becoming very long if JS or the sound gadget is disabled.
  • {{{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.

Examples[edit source]

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

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

Play my mixtape 🔥{{#while:

 | 
 | [[File:{{{ 3 }}}|class=sound-audio]]

}}


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{{#while:

 | 
 | [[File:{{{ 3 }}}|class=sound-audio]]

}} is the subject of a community-made creepypasta.


In an infobox
{{entity
|sounds=
* {{sound|'''Idle'''|Villager1.ogg|Villager2.ogg|Villager3.ogg}}
* {{sound|'''Hurt'''|Villagerhurt1.ogg|Villagerhurt2.ogg|Villagerhurt3.ogg|Villagerhurt4.ogg}}
* {{sound|'''Die'''|Villagerdead.ogg}} 
* {{sound|'''Trading'''|Villagertrade1.ogg|Villagertrade2.ogg|Villagertrade3.ogg}}
* {{sound|'''Trading complete'''|Villageraccept1.ogg|Villageraccept2.ogg}}
* {{sound|'''Trading denied'''|Villagerdeny1.ogg|Villagerdeny2.ogg}}
}}
Sound
No image.svg
Sounds Villager2.ogg File:Villager2.ogg

}}

Villagerhurt2.ogg File:Villagerhurt2.ogg

}}

[[File:{{{ 3 }}}|class=sound-audio]]

}}

Villagertrade2.ogg File:Villagertrade2.ogg

}}

Villageraccept2.ogg File:Villageraccept2.ogg

}}

Villagerdeny2.ogg File:Villagerdeny2.ogg

}}

Internal ID

?

Namespaced ID

?

[view | edit | history | purge]The above documentation is transcluded from Template:Sound/doc.