Questions answered by this recipe
How can I use the (not so) new HTML5
This recipe provides the HTML5 <audio> tag for PmWiki.
Audio5 Markup extensions
This recipe adds the
This example will embedd the audio file myaudio on your page.
You'll then have to upload the audio files to PmWiki as you would do it with any upload.
There are three supported audio formats for the <audio> element: MP3, Wav, and Ogg. Not every browser supports all formats. It is therefore recommended that you upload your audio in at least two formats:
More on audio format browser support: http://en.wikipedia.org/wiki/HTML5_audio#Supported_audio_codecs
Update 2015: MP3 seems to be the best supported codec today. If you want to upload just one file use mp3.
Audio5 supports all attributes of the HTML <audio> Tag. Here is an example where all possible options are being used:
In this example all options are set to their default values.
The detailed effect of the options is described on various websites, e.g. http://www.w3schools.com/tags/tag_audio.asp.
You can change the default values in your config.php by setting any of these variables before including audio5.php:
$AudioPreload = 'auto'; // (auto|metadata|none) $AudioAutoplay = 0; $AudioControls = 1; $AudioLoop = 0;
Default audio order
By default Audio5 loads video files in the following order: mp3, ogg, wav
You can change this behaviour in your config.php before including audio5.php:
PmWiki setting EnableDirectDownload
Maybe you don't have enough storage to store audio files in the same place as other PmWiki attachments. If so, you can configure the source URL to point to your audio storage.
An example setting for config.php (note the trailing slash):
You'll now need to upload your audio files to this place.
Users of old browsers will see a message, showing the lack of HTML <audio> support. You can change this message in config.php:
Change log / Release notes
See discussion at Audio5-Talk