Template:listen/documentation

From Wiktionary, the free dictionary
Jump to navigation Jump to search
Documentation for Template:listen. [edit]
This page contains usage information, categories, interwiki links and other content describing the template.

{{listen}} is used for displaying an audio file connected to the meaning of the entry – for example, a recording of a klaxon sound in the klaxon entry.

For audio files containing pronunciations or spoken language (for instance, a recording of the word "klaxon" being spoken), {{audio}} should be used instead.

Simple usage

[edit]
{{listen|filename|description}}

or:

{{listen|filename=filename|description=description}}
  • filename (Required): the pagename of the media file, without the File: prefix
  • description: a caption to be displayed beneath the audio file

Multiple files

[edit]

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     =
| alt          =
| description  =
| filename2    =
| alt2         =
| description2 =
| filename3    =
| alt3         =
| description3 =
}}
  • filename (Required): the pagename of the media file, without the File: (formerly Image:) prefix
  • alt: alt text for the image displayed for the file, for visually impaired readers. This is needed for files that include video as well as sound. The alt text should describe just the initial static image, not the entire video or its sound.
  • description: a description of the audio file

Style parameters

[edit]

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
    • speech
    • music (default)
  • inline: disables the default float: right; added to the style by default.
  • style: can be used to pass specific style instructions to the box. Setting this to float:none will anchor the box when this is convenient. Setting this to float:none; clear:none will enable the anchored box to co-exist gracefully beside another floating 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.

Examples

[edit]
Basic example
{{listen|Accordion chords-01.ogg|Accordion chords}}


Example with video
{{listen
| filename    = Barack Obama inaugural address.ogv
| alt         = A black man in a black coat gestures and talks at a lecturn surrounded by teleprompters. Behind him, in the background, are about a dozen warmly-dressed onlookers.
| description = Barack Obama delivers his [[inaugural address]] on January 20, 2009.<br>(Duration: 21 minutes, 21 seconds)
| type        = sound
}}


Example with header
{{listen|Phrase de Neil Armstrong.oga|"One small step for a man...", the first words spoken on the [[moon]].|type=speech}}


Multiple files
{{listen
| filename     = Accordion chords-01.ogg
| description  = Chords being played on an accordion
| type         = music
| filename2    = Moonlight.ogg
| description2 = [[Beethoven]]'s "Moonlight" Sonata in C-sharp minor
}}