Template:Listen

来自维基百科
蹦到: 导航搜寻
碰着问题?请看媒体帮助
文檔圖標 模板文檔[查看] [編纂] [歷史] [清除緩存]

{{Listen}} 可用來將音頻、視頻文件嵌進文章當中。渠應該用勒搭正文分開嗰音頻文件上向,譬如音楽片段或者錄音。

參數搭使用方法[编辑]

基礎用法[编辑]

{{Listen
| filename    = <!-- 文件名(必填) -->
| title       = <!-- 顯示標題(必填) -->
| description = <!-- 描述 -->
| pos         = <!-- 位置(填left 或者right)-->
}}
  • filename(必填):媒體文件嗰頁面名稱,覅File:(或者文件:Image:)之類嗰前綴。
  • title(必填):要顯示嗰音頻文件嗰標題。覅出現引號、wikilinks。
  • description:音頻文件嗰描述。
  • pos:顯示位置,填left 或者right。不填,則默認顯示了左面。

擴展用法[编辑]

額外嗰文件可用同一個模板、畀每個參數附加數字,嵌進文章當中。最多可包括十個文件。

{{Listen
| filename     = <!-- 文件名 -->
| title        = <!-- 顯示標題 -->
| alt          = <!-- 替代文本 -->
| description  = <!-- 描述 -->
| filename2    = <!-- 文件名2 -->
| title2       = <!-- 顯示標題2 -->
| alt2         = <!-- 替代文本2 -->
| description2 = <!-- 描述2 -->
| filename3    = <!-- 文件名3 -->
| title3       = <!-- 顯示標題3 -->
| alt3         = <!-- 替代文本3 -->
| description3 = <!-- 描述3 -->
}}
  • filename(必填):媒體文件嗰頁面名稱,覅File:(或者文件:Image:)之類嗰前綴。
  • title (必填):要顯示嗰音頻文件嗰標題。覅出現引號、wikilinks。
  • alt:替代文本,用來替代文件嗰顯示圖像,是為視覺障礙讀者準備嗰;參看en:Wikipedia:Alternative text for images。箇是類似Ogg.ogv)迭種格式所需要嗰,包括視頻及音頻。替代文本應描述一開始嗰靜態圖像,而不是整個視頻或者渠嗰音頻。
  • description:對音頻文件嗰描述。

樣式參數[编辑]

箇模板還帶了多個參數來控制渠嗰顯示:

  • type: can be used to alter the image displayed at the left depending on the type of audio content being embedded. Acceptable values are music, speech and sound (default)
  • header: can be used to add a header to the box.
  • help: if set to |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.
  • image: define a different image. Eg |image=[[File:Example.jps|20px]]

. You can set |image=none to disable the image entirely.

  • 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.
  • plain: if set |plain=yes, removes most of the ornamentation (table border, image, and help links) to give a minimalist version. This also removes the left/right float and positioning, to allow the box to be manually positioned as desired using the |style= (e.g., |style=float:right) parameter and surrounding markup.
  • embed: use |embed=yes to remove border and padding when using as a module embedded in another infobox (see examples below).

Examples[编辑]

Basic
Chords being played on an accordion

碰着问题?请看媒体帮助
{{Listen
| filename    = Accordion chords-01.ogg
| title       = Accordion chords
| description = Chords being played on an accordion
}}
With video
Inaugural Address
Barack Obama delivers his inaugural address on January 20, 2009.
(Duration: 21 minutes, 21 seconds)

{{Listen
| header      = Inaugural Address
| 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.
| title       = Inaugural address of Barack Obama
| description = Barack Obama delivers his [[inaugural address]] on January 20, 2009.<br>(Duration: 21 minutes, 21 seconds)
| help        = no
| type        = sound
}}
With header
Recordings of this phrase:
First words spoken on the Moon.

碰着问题?请看媒体帮助
{{Listen
| filename    = Frase de Neil Armstrong.ogg
| title       = "One small step for a man..."
| description = First words spoken on the [[Moon]].
| type        = speech
| pos         = left
| header      = Recordings of this phrase:
}}
Embedding
Dr. Accordion
职业 Accordion player

{{Infobox person
| name = Dr. Accordion
| occupation = Accordion player
| module = 
{{Listen
| filename = Accordion chords-01.ogg
| title    = Accordion chords
| embed    = yes
}}
}}
Plain

{{Listen
| filename = Accordion chords-01.ogg
| title    = Accordion chords
| plain    = yes
| style    = float:left
}}
Multiple files
Chords being played on an accordion

Beethoven's "Sonata in C-sharp minor"

The traditional French children's song

碰着问题?请看媒体帮助
{{Listen
| filename     = Accordion chords-01.ogg
| title        = Accordion chords
| description  = Chords being played on an accordion
| type         = music
| filename2    = Moonlight.ogg
| title2       = ''Moonlight Sonata''
| description2 = [[Beethoven]]'s "Sonata in C-sharp 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
}}

參看[编辑]