CentOS Firefox 10 HTML5 Audio

These tags allow you to specify that audio be played through Windows Media Player Plugin if it is available, and if it isn’t, use an HTML5 audio tag.


<object id="wmp_p" data="audio.wav" type="application/x-ms-wmp" width="175" height="75" >
      <param name="autostart" value="true" />
      <param name="volume" value="10" />
      <param name="uiMode" value="mini" />
	<audio autoplay="autoplay" controls="controls" style="height:75px;width:175px">
		<source src="audio.wav" type="audio/wav" />
		No audio player available, download <a href="audio.wav" title="Download audio">audio.wav</a>
	</audio>
    </object>

This was tested under CentOS 5.4, with Firefox 10.0.2, and it worked nicely. It may also work well with Chrome under Linux, as well as under Windows.

Notes

  • Different browser support different audio formats with the tag.
  • There may be subtle coding differences between the tags and attributes. Test thoroughly and carefully.
  • There may be layout issues across different browsers, again, test thoroughly and carefully.

Audio encoding that works well under CentOS/Firefox 10.0.2

sox -V input.wav -u -b -r 8000 -c 1 output.wav

sox: Writing Wave file: Microsoft PCM format, 1 channel, 8000 samp/sec
sox: 8000 byte/sec, 1 block align, 8 bits/samp