Adding Audio

Certify and Increase Opportunity.
Be
Govt. Certified HTML5 Developer

In some browsers, no extra plug-in for MP3 or WAVE file format is needed. MP3 or WAV files can be hyperlinked without any <object> or <embed> tag as many browsers can play it but there is no control on interface of player. Hence flash is used for playing audio.

<a href=”music1.mp3”>music1 mp3</a>

But by including the audio file in <object> tag, browser will play it as per the type of plug-in value given and <object> tag technique may not play audio as different versions of browsers need different usage of the <object>, hence the <embed> tag is used inside an <object> element as shown

<object width=”300” height=”42” type=”audio/mpeg” data=”sound/play1.mp3”> <param name=”src” value=” sound/play1.mp3” /> <param name=”autoplay” value=”true” /> <param name=”autostart” value=”1” />

<embed src=” sound/play1.mp3” width=”300” height=”42” > </embed>

</object>

As explained earlier, the size of the player is as per the width and height attributes, the <param> tag and <embed> tag have same attributes. ‘classid’ attribute is used to specify media player installed on PC and if it is not installed, user needs to download it. Some values for different media players of classid attribute are

classid for Real Player: clsid:CFCDAA03 – 8BE4 – 11cf – B84B – 0020AFBBCCFA

classid for QuickTime: clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B

Get industry recognized certification – Contact us

Menu