fix(scanner): agregar metodos de audio faltantes y blindar handleAdminQrDetected contra excepciones
This commit is contained in:
@@ -119,6 +119,34 @@ class SoundEffects {
|
||||
osc.stop(now + 0.35);
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
// Sonido de clic / tap sutil
|
||||
playTap() {
|
||||
try {
|
||||
this.init();
|
||||
const now = this.ctx.currentTime;
|
||||
const osc = this.ctx.createOscillator();
|
||||
const gain = this.ctx.createGain();
|
||||
|
||||
osc.type = 'sine';
|
||||
osc.frequency.setValueAtTime(600, now);
|
||||
osc.frequency.exponentialRampToValueAtTime(300, now + 0.04);
|
||||
|
||||
gain.gain.setValueAtTime(0.08, now);
|
||||
gain.gain.exponentialRampToValueAtTime(0.001, now + 0.04);
|
||||
|
||||
osc.connect(gain);
|
||||
gain.connect(this.ctx.destination);
|
||||
|
||||
osc.start(now);
|
||||
osc.stop(now + 0.04);
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
// Sonido de escaneo / beep
|
||||
playBeep() {
|
||||
this.playScanChirp();
|
||||
}
|
||||
}
|
||||
|
||||
window.sounds = new SoundEffects();
|
||||
|
||||
Reference in New Issue
Block a user