Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Is there a way to make chat messages with an audio alert?

By
Miles Cantley
on 1/6/15, 4:25 AM 449 views

We are running Odoo v8 and the chat system works fine, but there is no audio notification, which makes it easy to miss messages. Is there a way to provide this somehow?

0
Dr Obx
On 4/2/15, 8:19 AM

I think the easiest way would be just add Audio Web API and something like this into the im_chat.js


var beep = function(duration, type, finishedCallback) {

if (!(window.audioContext || window.webkitAudioContext)) {

throw Error("Your browser does not support Audio Context.");

}

duration = +duration;

// Only 0-4 are valid types.

type = (type % 5) || 0;

if (typeof finishedCallback != "function") {

finishedCallback = function() {};

}

var ctx = new (window.audioContext || window.webkitAudioContext);

var osc = ctx.createOscillator();

osc.type = type;

osc.connect(ctx.destination);

osc.noteOn(0);

setTimeout(function() {

osc.noteOff(0);

finishedCallback();

}, duration);

};

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/6/15, 4:25 AM
Seen: 449 times
Last updated: 4/2/15, 8:19 AM