fix(scanner): agregar metodos de audio faltantes y blindar handleAdminQrDetected contra excepciones

This commit is contained in:
unknown
2026-10-04 23:27:35 -06:00
parent f1366e5fd5
commit 9ab515fe1a
3 changed files with 136 additions and 78 deletions
+28
View File
@@ -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();