...

View Full Version : Pause Audio



metalvoice
09-13-2008, 02:18 PM
hi all i am using javascript code to play several sound files in my website using this code:


</script>

<!-- -->
<bgsound id="soundfiles">
<script language="JavaScript"><!-- // Sound on Mouseover javascript supplied by http://www.**************
var aySound = new Array(); // PLACE YOUR SOUND FILES BELOW
aySound[0] = "sounds/01.mp3";
aySound[1] = "sounds/02.mp3";
aySound[2] = "sounds/03.mp3";
aySound[3] = "sounds/04.mp3";
aySound[4] = "sounds/05.mp3";
aySound[5] = "sounds/06.mp3";
aySound[6] = "sounds/07.mp3";
aySound[7] = "sounds/08.mp3";
// Don't alter anything below this line
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)?
1:0; NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])?
1:0; ver4 = IE||NS? 1:0; onload=auPreload;
function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else { Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str); } var Str = '';
for(i=0;i<aySound.length;i++)
Str += "<EMBED SRC='"+aySound[i]+"'AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else { auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close(); }
auCon = IE? document.all.soundfiles:auEmb; auCon.control = auCtrl; }
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()")) }

function playSound(whSound)
{
if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound)
{

if (window.auCon) auCon.control(whSound,false); }

//-->
</script>

i need to add a pause function to this code so i cane pause sound not stop it
please help me
best regards

rubenbuhr
09-14-2008, 02:03 AM
pause() is what you want. Need more?

metalvoice
09-14-2008, 06:41 AM
thank you for your reply
yes i need to know how to add the pause function in this code so i can handle it on a button

A1ien51
09-15-2008, 02:32 AM
Use this library: http://www.schillmania.com/projects/soundmanager2/

Eric



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum