Templat:Listen/doc

Daripada Wikipedia, ensiklopedia bebas.

This template allows audio files to be embedded in articles. It should be used for audio files that are set off from the text, like music clips or sound recordings.

Usage[sunting sumber]

Simple[sunting sumber]

In its most simple form, the template takes the following parameters:

{{Listen
 |filename     = 
 |title        = 
 |description  = 
}}
  • filename (Required) – the pagename of the media file, without the File: (formerly Image:) prefix
  • title (Required) – the title of the audio file, to be displayed
  • description – a description of the audio file
Example
{{Listen
 |filename     = Accordion chords-01.ogg
 |title        = Accordion chords
 |description  = Chords being played on an accordion
}}

Multiple files[sunting sumber]

Additional files can be embedded in an article with one template by appending a number to each parameter. Up to ten files can be included.

{{Listen
 |filename     = 
 |title        = 
 |description  = 
 |filename2    = 
 |title2       = 
 |description2 = 
 |filename3    = 
 |title3       = 
 |description3 = 
}}
  • filename (Required) – the pagename of the media file, without the File: (formerly Image:) prefix
  • title (Required) – the title of the audio file, to be displayed
  • description – a description of the audio file
Example
{{Listen
 |filename     = Accordion chords-01.ogg
 |title        = Accordion chords
 |description  = Chords being played on an accordion
 |filename2    = Moonlight.ogg
 |title2       = ''Moonlight Sonata''
 |description2 = [[Beethoven]]'s Sonata in C# minor
 |filename3    = Au_clair_de_la_lune_mode_do.mid
 |title3       = Au Clair de la Lune
 |description3 = The traditional French children's song
 |play3        = no
}}

Style parameters[sunting sumber]

The template also takes a number of style parameters to control its appearance:

  • type – can be used to alter the image displayed at the left depending on the type of audio content being embedded. Acceptable values are sound and music (default)
  • header – can be used to add a header to the box.
  • help – if set |help=no, suppresses the help text that normally appears at the bottom of the box. Only do this if there are other audio files on the page which do have the help link; it must be provided on at least the first file on the article.
  • pos – by default the box floats to the right side of the screen. Setting this to left will cause the box to instead float on the left-hand side.
  • style – can be used to pass specific style instructions to the box.
  • play# – some media files cannot be displayed inline; if this is the case set |play=no to prevent the broken inline link from displaying.
  • plain – if set |plain=yes, removes most of the ornamentation (table border, image, and help links) to give a minimalist version.
Example
{{Listen
 |filename     = Phrase de Neil Armstrong.oga
 |title        = "One small step for a man..."
 |description  = First words spoken on the [[moon]].
 |type         = sound
 |pos          = left
 |header       = Recordings of this phrase:
}}

See also[sunting sumber]

  • {{Audio}}, a variant of this template meant more for inline sounds like pronunciations.