Author Topic: How to create a looping notification sound  (Read 41058 times)

0 Members and 1 Guest are viewing this topic.

theoldschooler

  • Jr. Member
  • **
  • Posts: 3
How to create a looping notification sound
« on: March 22, 2011, 06:39:15 PM »
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: [Select]
<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>


- Open up /webim/js/163/users.js and find the following code.
Code: [Select]
alert(localized[(3+2)]);
- Replace it with the following.
Code: [Select]
window.open("/webim/alert.html","Window1","menubar=no,width=200,height=100,toolbar=no");
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

  • Jr. Member
  • **
  • Posts: 1
Re: How to create a looping notification sound
« Reply #1 on: April 13, 2011, 03:11:22 PM »
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

  • Jr. Member
  • **
  • Posts: 1
Re: How to create a looping notification sound
« Reply #2 on: October 06, 2011, 06:40:15 PM »
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: [Select]
alert(localized[(2+3)]);
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: [Select]
beep.play(2)
to whatever number you want listed at flashbeep.net

Thanks for the mod theoldschooler! Awesome!

xmurph

  • Jr. Member
  • **
  • Posts: 1
Re: How to create a looping notification sound
« Reply #3 on: October 20, 2011, 12:45:31 PM »
to 1.64 i've modifyed the alert.html to show in the pop up a red message

Code: [Select]
<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>


von1

  • Jr. Member
  • **
  • Posts: 4
Re: How to create a looping notification sound
« Reply #4 on: January 11, 2012, 07:17:30 PM »
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: [Select]
<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>

6opo9a

  • Jr. Member
  • **
  • Posts: 2
Re: How to create a looping notification sound
« Reply #5 on: April 23, 2012, 03:55:47 PM »
Made more beautiful patch, in \js\164\users.js find:
Code: [Select]
(value[2]!='chat'?this.uj(value[1]):'-'));replace to
Code: [Select]
(value[2]!='chat'?this.uj(value[1]):'-'));if(value[2]!='chat')vs($u+'/sounds/new_user.wav');
Or in \js\source\users.js find updateTimers: function() :
Code: [Select]
setcell(this.t, row,"wait",(value[2]!='chat' ? this.getTimeSince(value[1]) : '-'));and add line after:
Code: [Select]
if (value[2]!='chat') playSound(webimRoot+'/sounds/new_user.wav');

joaoantonio

  • Jr. Member
  • **
  • Posts: 2
Probelmas to download
« Reply #6 on: December 17, 2013, 07:45:03 PM »
Could someone help me to download a file on this site: http://flashbeep.net/#alarm . I tried this but giving error or the page simply does not load, it is not because of the signal, or my browser, I do not know what can be. the file is flashbeep_alert.swf alert category. If someone can download let me know please. And if you can send it to my emai: jasouza96@gmail.com

chickeneps

  • Jr. Member
  • **
  • Posts: 3
Re: How to create a looping notification sound
« Reply #7 on: May 08, 2015, 01:36:28 AM »
It's now 2015 and I just got MIBEW installed. It seems to me that any alert should be looping by default. There are SO MANY REASONS why an operator would miss an initial audible alert.

I assume that MIBEW simply sends a single alert upon chat request and leaves it be. Is that correct? If so, that should be redesigned. Or at least have it controllable via the Settings menu. Huge oversight!!!

If so, can anyone update this thread to apply to the current MIBEW? The folders are wrong, and when I try to edit users.js, it's the biggest mess I've ever seen - there's no line breaks in the code.

Dmitriy Simushev

  • Native
  • *****
  • Posts: 345
Re: How to create a looping notification sound
« Reply #8 on: May 08, 2015, 09:57:43 AM »
First of all I assume that you are using Mibew 2.0.0 because 1.6.x branch is obsolete now.

Quote
I assume that MIBEW simply sends a single alert upon chat request and leaves it be. Is that correct?

Yes, it's correct. Just a single sound is emitted for each new thread.

Quote
If so, that should be redesigned. Or at least have it controllable via the Settings menu. Huge oversight!!!

There will be neither redesign nor option in Settings menu. If operator missed an alert it's not a technical problem. It's a problem of operator's workflow.

Nevertheless, you can use Title Notification plugin (https://mibew.org/plugins#mibew-title-notification) or create another plugin that loops sound alert to get operator's attention.

Quote
The folders are wrong, and when I try to edit users.js, it's the biggest mess I've ever seen - there's no line breaks in the code.

All JavaScript files in Mibew are minified now. If you want to edit them, you should alter the sources from the official repository (https://github.com/Mibew/mibew/tree/master/src/mibew/js/source) and then rebuild Mibew (see http://docs.mibew.org/development/build-system.html for details).

chickeneps

  • Jr. Member
  • **
  • Posts: 3
Re: How to create a looping notification sound
« Reply #9 on: May 08, 2015, 01:47:00 PM »
Thanks for the reply, I'll try what you suggested.

But going further: Personal opinion: I think you are aren't aware enough that people install MIBEW from easy-installers provided by hosters. "Rebuild from sources" or other doesn't make any sense to those people. For me, even though I might understand such things, I don't have time to fiddle with that anyway.

Regarding the looping alert thing: I think you completely misunderstood what I said. It's not a technical problem at all, it's an oversight on the software meeting normal usual human needs, which is the ultimate goal of all software in the first place.

I'm kind of stunned that you think that continual notifications are a reflection on "poor" (I'm assuming) operator workflow. I can think of many reasons why an even an excellent customer service person would might miss an initial alert. Since I don't think you are aware of these arguments, let me go down a couple strong arguments for it.

(I consider an alert being both the alert that a Chat is being requested AND that the other side has replied and is waiting for your reply. Although I think I'm mostly arguing for the initial alert.)

All I was saying was that, as the developer, this is something you should STRONGLY consider.

1) Many people are listening to music as they work, an alert can get buried in that.

2) I can imagine most people doing Chat aren't doing it for the full 8 hours they are working, often they are doing something else. That means they could be in another room temporarily and miss it, or going to the bathroom. (Since when is peeing "poor" workflow???)

3) I'm a programmer and most of the time I'm programming, which as you know requires intense concentration. I've been doing this for many years. It's not uncommon that I'll be notified to do something (a single alert) and I say "I'll get to it" and then I forget under the concentration I'm under. Then I'm reminded in some way and I do it. This isn't "poor" workflow, it's human nature. Software is supposed to HELP people, not "reward people for good habits".

In fact, during chats, I've been guilty of waiting for the other side to reply - which sometimes takes awhile - and I go off doing something else. I use a KVM switch among 4 computers and often I'm looking at another computers feedback, not the Chat computers. Then I forget all about the Chat. Sure, that's a bad habit, but what I'm pointing out is that it's easy for ANYONE who is multitasking (who isn't nowadays) to forget an initial alert on ANYTHING.

4) I used WebSiteAlive for many years, this was the default, also unchangeable, and I never thought twice about it being annoying or non-intuitive. I don't know of other chat software but I would think that ALL OF THEM do continual alerts.

5) Simple logic: looping the alert at ANY interval (5 sec, 60sec, whatever) is BETTER in EVERY WAY than just a single alert with absolutely NO downsides to the idea. If you have a single alert, than it is assumed that the operator is going to pick it up right away. If he/she doesn't, WHY NOT notify them again on a consistent basis? Isn't that obvious?

6) C'mon, this would take you 30 minutes maximum to code. Get on it, dude. =)

If I'm incorrect in my assessment, correct me. =) Thanks for your time.

Dmitriy Simushev

  • Native
  • *****
  • Posts: 345
Re: How to create a looping notification sound
« Reply #10 on: May 08, 2015, 02:06:15 PM »
Quote
But going further: Personal opinion: I think you are aren't aware enough that people install MIBEW from easy-installers provided by hosters. "Rebuild from sources" or other doesn't make any sense to those people. For me, even though I might understand such things, I don't have time to fiddle with that anyway.

If you want to use patched Mibew core you have to rebuild it from sources. If you cannot use basic version with plugins.

Quote
Regarding the looping alert thing: I think you completely misunderstood what I said. It's not a technical problem at all, it's an oversight on the software meeting normal usual human needs, which is the ultimate goal of all software in the first place.

I'm kind of stunned that you think that continual notifications are a reflection on "poor" (I'm assuming) operator workflow. I can think of many reasons why an even an excellent customer service person would might miss an initial alert. Since I don't think you are aware of these arguments, let me go down a couple strong arguments for it.

(I consider an alert being both the alert that a Chat is being requested AND that the other side has replied and is waiting for your reply. Although I think I'm mostly arguing for the initial alert.)

All I was saying was that, as the developer, this is something you should STRONGLY consider.

1) Many people are listening to music as they work, an alert can get buried in that.

2) I can imagine most people doing Chat aren't doing it for the full 8 hours they are working, often they are doing something else. That means they could be in another room temporarily and miss it, or going to the bathroom. (Since when is peeing "poor" workflow???)

3) I'm a programmer and most of the time I'm programming, which as you know requires intense concentration. I've been doing this for many years. It's not uncommon that I'll be notified to do something (a single alert) and I say "I'll get to it" and then I forget under the concentration I'm under. Then I'm reminded in some way and I do it. This isn't "poor" workflow, it's human nature. Software is supposed to HELP people, not "reward people for good habits".

In fact, during chats, I've been guilty of waiting for the other side to reply - which sometimes takes awhile - and I go off doing something else. I use a KVM switch among 4 computers and often I'm looking at another computers feedback, not the Chat computers. Then I forget all about the Chat. Sure, that's a bad habit, but what I'm pointing out is that it's easy for ANYONE who is multitasking (who isn't nowadays) to forget an initial alert on ANYTHING.

4) I used WebSiteAlive for many years, this was the default, also unchangeable, and I never thought twice about it being annoying or non-intuitive. I don't know of other chat software but I would think that ALL OF THEM do continual alerts.

5) Simple logic: looping the alert at ANY interval (5 sec, 60sec, whatever) is BETTER in EVERY WAY than just a single alert with absolutely NO downsides to the idea. If you have a single alert, than it is assumed that the operator is going to pick it up right away. If he/she doesn't, WHY NOT notify them again on a consistent basis? Isn't that obvious?

You don't get the main idea. I don't say that looping sound notifications are bad.

Here is the deal: there are the Core and Plugins. We try to keep the core as small as possible. All stuff that can be implemented as plugins must be implemented as plugins. The feature you are asking for can be easily implemented as a plugin thus it will never be included in the Core. That's it.

Quote
6) C'mon, this would take you 30 minutes maximum to code. Get on it, dude. =)

Personally I don't need looping sound notification, so I will not create a plugin for it. You can do it by yourself or hire somebody.

chickeneps

  • Jr. Member
  • **
  • Posts: 3
Re: How to create a looping notification sound
« Reply #11 on: May 08, 2015, 03:16:58 PM »
I understand

However my reply was mostly based on your comment on your implication (I assume you mean it) that continuous notifications are making up for a somehow faulty workflow on the part of the user. Which is not true at all; hence my arguments.

My arguments were meant to persuade you that continual notifications are (IMHO by far) should be the default behavior, and thus SHOULD be included in the Core.

Perhaps you "personally" don't see the need, but as a programmer myself, I have to take into account the clients needs, not necessarily mine.

But even so, I also argued that this isn't a "either/or" thing, it only makes the software BETTER. The is no trade-off, it's only a positive, and it's easy to code. (If you don't like to be bugged by continual notifications, either answer the dang chat or refuse the chat. Remember, I'm speaking mostly on the initial chat request, although continual would be helpful for alerts during the chat.)

Of course, I know as a developer you can't put EVERYTHING into a program, but this is an extremely relevant improvement. I posted the arguments for at length to convince you of the relevancy. In my limited chat-software experience, they all do continual notifications. I was surprised yours didn't.

One other argument: I suppose many developers aren't taking Chat requests once every 10 minutes. For me, it's like 2 a day, if I'm lucky. Constantly toggling the Available switch on something that is infrequent is inefficient and open to lots of "oh, I forgot to switch it, oh well..."

Continual Notifications are, IMHO, an extremely natural part of any Chat system. Who WOULDN'T want to be notified at certain intervals that there is a Chat request waiting? There's a lot of comfort knowing that a Chat request is persistently ask you to acknowledge it. We're all busy people.

OK, upon knowing that I'm sure you are totally persuaded and that today you'll write new code into the Core and it'll be available in the next minor release, which I can download with the auto-installers provided by the hosts (in my case Softaculous), I can be grateful. =) But just in case you're not, being pragmatic, I'm not in a position to write a plugin for this. Are there people that are? Is there anyone I can contact that would be willing to do this?

Anyway, thanks for listening, just trying to be helpful.

Dmitriy Simushev

  • Native
  • *****
  • Posts: 345
Re: How to create a looping notification sound
« Reply #12 on: June 08, 2015, 10:30:49 AM »
@chickeneps I have good news for you. There is a third-party plugin for looping sound notification: https://mibew.org/plugins#aarinnovations-sound-notification