Template:IPA soundbox
This template produces a standard box to start a sound file. It has some extra features to help linking to a phonetic sound file. Also, there are options to format possible error messages and to alter the layout of the box. Basic examples:
{{IPA soundbox|ə}}
→yes{{IPA soundbox||χ|Voiceless_uvular_fricative.ogg}}
→yes
Usage
The box is created in three steps:
Step 1. Determine the soundfile name
- - By using input IPA symbol, looked up in a list:
<syntaxhighlight lang="text" enclose="none">ipa symbol=p</syntaxhighlight>
→yes - - Use input soundfile:
<syntaxhighlight lang="text" enclose="none">soundfile=bilabial click.ogg</syntaxhighlight>
→yes
Step 2. Check if the soundfile exists This check may prevent red links and (undesired) repeated checks
Step 3. Create the standard browser soundbox on the page, using [[File:soundfile]] Here the information is put together, optional settings such as size are used, and the result is soundbox.
{{IPA soundbox|p|size=60px}}
→- yes
Input options
- a.
<syntaxhighlight lang="text" enclose="none">checkexist=no</syntaxhighlight>
: skip (expensive) check on file existence. Default=yes (do the check). - b. layout of the soundbox (these settings use basic layout parameters):
- -
<syntaxhighlight lang="text" enclose="none">showicon=no</syntaxhighlight>
: show info icon ("noicon" in basic) - -
<syntaxhighlight lang="text" enclose="none">size=50px</syntaxhighlight>
size (in px: default =250px, minimum is ~40px) Basic: width. - -
<syntaxhighlight lang="text" enclose="none">style</syntaxhighlight>
: any style (CSS format) to be used, e.g.<syntaxhighlight lang="text" enclose="none">style=background:yellow;</syntaxhighlight>
{{IPA soundbox|| ipa symbol=m| size=120px| style=border:1px solid red; background:yellow;}}
→
yes
- c. When an error would exist, show an error message:
- - default: show errormessage as error message
- -
<syntaxhighlight lang="text" enclose="none">errortext=something is wrong</syntaxhighlight>
: Show alternate text when error - -
<syntaxhighlight lang="text" enclose="none">errortext=</syntaxhighlight>
: blank, no output at all (no showbox)
Example of check file once:
- See {{infobox IPA}}. First the file is checked, and returns filename if exists. Then if there is a filename, the infobox row is composed, including the soundbox set with
<syntaxhighlight lang="text" enclose="none">checkexist=no</syntaxhighlight>
.
- Full parameter list
{{IPA soundbox <!-- GENERAL --> | ipa symbol = | style = | errortext = <!-- ABOVE --> | show box above= | IPAsym name = | showsymbol = | line-height = <!-- PLAYER --> | soundfile = | checkexist = | showicon = | width = | size = }}
- Possible errors
- 1. IPA symbol unknown in IPAsym list
- 2. File does not exist
- When an error exists, no button will be shown.
Related pages
{{IPA audio filename}}
{{infobox IPA}}
(uses this template internally){{IPA vowels audio}}
(uses this template internally){{IPA pulmonics audio}}
(uses this template internally)
The above documentation is transcluded from Template:IPA soundbox/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |