<div id="sound" >
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="0" HEIGHT="0" id="Yourfilename" ALIGN="">
<PARAM NAME=movie VALUE="sample.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#333399>
<EMBED src="sample.swf" quality=high bgcolor=#333399 WIDTH="0" HEIGHT="0" NAME="Yourfilename" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
</div>
I want to get the duration time of this sound, and convert it to seconds, then play this sound from a specific time.
For example, playing this sound from 40 seconds.
How can I do it?
As you have been told previously, don’t use deprecated tags, and try to use the fresh
<audio>tag from HTML5 for doing that.You’ll have to call
audio.duration. Check this already answered question from this same site. Try something like this:Good luck.
Edited: If you want to start after, i.e., 20 seconds, you shall call to
audioElement.currentTime=20;and then calling toaudioElement.play();at your js$(document).ready(function()). Ask if you need anything else.