Jump to content

Template:Audio player

From WhiskerWiki

This template wraps a {{#widget:AudioPlayer}} call for embedding a species vocalization recording.

Example call
Recorded by Jane Doe, 2024.

How to use it

On a species page, called with no parameters it defaults to a file named after the page itself:
{{Audio player}} → looks for {{PAGENAME}}.opus

To caption the recording, credit it, use a different file, or override the width:
{{Audio player|title=Male advertisement call|attribution=Recording courtesy of the Pasch Lab (Kobrina et al. 2022).|file=Some other file.opus|width=350px}}

title and attribution are both optional -- omit either and nothing renders in its place. Unlike title, attribution is plain wikitext (not a widget parameter), so it can carry ''italics'', [[links]], or a citation template -- useful for crediting a recordist or citing the paper a call came from.

Usually used through

⚠ Hearing safety warning
This recording contains sonic frequencies that may be inaudible but could still be harmful at high volume. Start at a very low volume and increase only if needed.

rather than directly, which pairs it with the hearing-safety warning in one connected card. Called directly, it's typically placed below {{Hearing safety warning}}, e.g.:

{{Hearing safety warning}}
{{Audio player}}

The outer <div class="whisker-audio-block"> isn't decorative -- without a literal <div> already present in this template's own wikitext, MediaWiki's paragraph-wrapper doesn't know {{#widget:AudioPlayer}}'s raw HTML is block-level (it's substituted back in as an opaque placeholder AFTER paragraph-wrapping runs, unlike a normal template transclusion), and wraps it in a stray <p> around a <div> -- invalid HTML that browsers "fix" by injecting extra empty, margined <p> elements. Confirmed via action=parse that this literal wrapper div avoids it.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.