Contributions > Plugins, tips, and tricks

How to create a looping notification sound

(1/3) > >>

theoldschooler:
In our office we wanted a way to have an audio notification that would continue to sound until the operator acknowledged it, in case they were away from their desk when the initial chat request came in. I came across this site in my search and it works perfectly with Mibew. Here's what to do.

- Download flashbeep_alert.swf and place it in your /webim/sounds directory.

- Create a file called alert.html in your /webim folder.

- Paste the following into alert.html. You can try different beep sounds and different delays by changing the values in "setInterval("beep.play(2)",'2500');".

--- Code: ---<html>
<head>
<title>New Visitor</title>
</head>
<body style="font-family: arial, sans-serif;">
<h2>New Visitor Waiting</h2>
<script type="text/javascript">
var beep;
function isReady()
{
beep = document.getElementById("beep");
setInterval("beep.play(2)",'2500');

}
</script>
<object id="beep" type="application/x-shockwave-flash" data="/webim/sounds/flashbeep_alert.swf" width="100" height="100">
<param name="movie" value="/webim/sounds/flashbeep_alert.swf" />
<param name="FlashVars" value="onLoad=isReady" />
</object>
</body>
</html>


--- End code ---

- Open up /webim/js/163/users.js and find the following code.

--- Code: ---alert(localized[(3+2)]);
--- End code ---

- Replace it with the following.

--- Code: ---window.open("/webim/alert.html","Window1","menubar=no,width=200,height=100,toolbar=no");
--- End code ---

You should now have a nice looping sound that will repeat until the operator closes the popup window.  8)

Couple of caveats: This only works in browsers that support flash, so no iPad or iPhone support. And you must make sure that your operator does not have popups blocked for your website. In the long run it would probably be smarter to use jquery to open alert.html in a lightbox or something so you don't have to deal with popup blocker issues, but this works for now.



Kirby1367:
This is a function I am very interested in.  The problem is I cannot seem to get this working when the folder is  /webim/js/164/users.js

The alert page is functioning correctly by itself, but the JS will not call the alert page.  I have changed the code about everywhere I can think and still continues to play the new_user.wav

Any advice would be appreciated.

robetus:
Alright!  Confirmed working with 1.6.4.  I'll add a step though.  If you have the popup notification window enabled in your optional services section then disable it before you begin installation of this mod, and then enable it when you finish installing it.  If it doesn't work right away disable the popup window, save, and enable it again, the popup window has to be enabled for this to work.  Also you have to look for:


--- Code: ---alert(localized[(2+3)]);
--- End code ---

in 1.6.4.  This is a great addition.  You can download flashbeep_alert.swf at flashbeep.net and you can change the alert sound by going into alert.html and changing:


--- Code: ---beep.play(2)
--- End code ---

to whatever number you want listed at flashbeep.net

Thanks for the mod theoldschooler! Awesome!

xmurph:
to 1.64 i've modifyed the alert.html to show in the pop up a red message


--- Code: ---<script type="text/javascript">
var beep;
function isReady()
{
        beep = document.getElementById("beep");
        setInterval("beep.play(1)",'2500');

}
</script>
<object id="beep" type="application/x-shockwave-flash" data="/sounds/flashbeep_alert.swf" width="50" height="8">
        <param name="movie" value="/sounds/flashbeep_alert.swf" />
        <param name="FlashVars" value="onLoad=isReady" />
</object>
<div style="text-align: center;">
<h1><small><span style="color: rgb(255, 0, 0);">INCOMING CHAT!!</span><br>
</small></h1>
</div>
</body>
</html>


--- End code ---

von1:
The swf kept giving me problems in different broswer.

Ok for the web guys this works well but workers can't always get quick time installed on firefox etc and company laptops are sometimes more locked down.

<BGSOUND> with a .wav file is a more simple and reliable way to create a sound on your .html page

Record a wav sound or modify one so it has the correct length to repeat.

Put the below code in the alert.html file


--- Code: ---<html>
<head>
<title>New Visitor</title>
<bgsound src="/path/to/alert.wav" loop="infinite">
</head>
<body style="font-family: arial, sans-serif;">
<h2>New Visitor Waiting</h2>
<p>ANY MORE STUFF YOU WANT TO SAY</p>
</body>
</html>

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version