Hello colleagues, my idea is to be able to reproduce a beep (notification sound) on a specific plan, with a group address. when its state is 1, it reproduces the sound, the problem is what reproduces on all pages and must be in one
Adjunto el código javascript
Gracias
Adjunto el código javascript
Code:
$(function(){
var context= new AudioContext();
function jsNota(frecuencia){
var o= context.createOscillator();
g=context.createGain();
o.connect(g);
o.type="sine";
o.frequency.value=frecuencia;
g.connect(context.destination);
o.start(0);
g.gain.exponentialRampToValueAtTime(0.00001,context.currentTime +1.5);
}
grp.listen('1/1/1', function(object, state) {
if (state == 'value' && object.value ) {
jsNota(1174.659, function() {
});
}
}, true);
});
Gracias