feat(audio): desactivar completamente todos los sonidos de la aplicacion y del inicio de sesion

This commit is contained in:
unknown
2026-10-08 13:49:03 -06:00
parent 186a0ebab9
commit dff03f98d0
5 changed files with 35 additions and 186 deletions
+3 -3
View File
@@ -3430,10 +3430,10 @@
</button>
</nav>
<script src="/js/dialogs.js?v=13.7"></script>
<script src="/js/sounds.js?v=9.6"></script>
<script src="/js/dialogs.js?v=13.8"></script>
<script src="/js/sounds.js?v=13.8"></script>
<script src="/js/jsQR.js"></script>
<script src="/js/food-icons.js?v=1.1"></script>
<script src="/js/app.js?v=13.7"></script>
<script src="/js/app.js?v=13.8"></script>
</body>
</html>
+25 -145
View File
@@ -1,152 +1,32 @@
// Sintetizador Web Audio API para feedback sonoro en tiempo real sin dependencias externas
// ========================================================
// SISTEMA DE SONIDOS SIBOPAY - COMPLETAMENTE DESACTIVADO
// Todos los efectos de sonido y alertas auditivas han sido removidos a solicitud.
// ========================================================
class SoundEffects {
constructor() {
this.ctx = null;
this.enabled = false;
}
init() {
if (!this.ctx) {
const AudioCtx = window.AudioContext || window.webkitAudioContext;
this.ctx = new AudioCtx();
}
if (this.ctx.state === 'suspended') {
this.ctx.resume();
}
}
// Sonido de escaneo exitoso / cobro completado (Tono alegre ascendente)
playSuccess() {
try {
this.init();
const now = this.ctx.currentTime;
const osc1 = this.ctx.createOscillator();
const osc2 = this.ctx.createOscillator();
const gain = this.ctx.createGain();
osc1.type = 'triangle';
osc2.type = 'sine';
// Acorde alegre de confirmación: C5 -> E5 -> G5
osc1.frequency.setValueAtTime(523.25, now);
osc1.frequency.exponentialRampToValueAtTime(659.25, now + 0.1);
osc1.frequency.exponentialRampToValueAtTime(783.99, now + 0.2);
osc2.frequency.setValueAtTime(261.63, now);
osc2.frequency.setValueAtTime(329.63, now + 0.1);
osc2.frequency.setValueAtTime(392.00, now + 0.2);
gain.gain.setValueAtTime(0.2, now);
gain.gain.exponentialRampToValueAtTime(0.01, now + 0.35);
osc1.connect(gain);
osc2.connect(gain);
gain.connect(this.ctx.destination);
osc1.start(now);
osc2.start(now);
osc1.stop(now + 0.35);
osc2.stop(now + 0.35);
} catch (e) {
console.warn('Audio no disponible:', e);
}
}
// Sonido de moneda para Modo Kids
playCoin() {
try {
this.init();
const now = this.ctx.currentTime;
const osc = this.ctx.createOscillator();
const gain = this.ctx.createGain();
osc.type = 'sine';
osc.frequency.setValueAtTime(987.77, now); // B5
osc.frequency.setValueAtTime(1318.51, now + 0.08); // E6
gain.gain.setValueAtTime(0.25, now);
gain.gain.exponentialRampToValueAtTime(0.01, now + 0.3);
osc.connect(gain);
gain.connect(this.ctx.destination);
osc.start(now);
osc.stop(now + 0.3);
} catch (e) {}
}
// Chirp de escáner láser de código de barras
playScanChirp() {
try {
this.init();
const now = this.ctx.currentTime;
const osc = this.ctx.createOscillator();
const gain = this.ctx.createGain();
osc.type = 'square';
osc.frequency.setValueAtTime(2000, now);
osc.frequency.exponentialRampToValueAtTime(1200, now + 0.06);
gain.gain.setValueAtTime(0.15, now);
gain.gain.exponentialRampToValueAtTime(0.01, now + 0.07);
osc.connect(gain);
gain.connect(this.ctx.destination);
osc.start(now);
osc.stop(now + 0.07);
} catch (e) {}
}
// Sonido de error / límite superado (Tono grave de advertencia)
playError() {
try {
this.init();
const now = this.ctx.currentTime;
const osc = this.ctx.createOscillator();
const gain = this.ctx.createGain();
osc.type = 'sawtooth';
osc.frequency.setValueAtTime(220, now);
osc.frequency.setValueAtTime(180, now + 0.15);
gain.gain.setValueAtTime(0.2, now);
gain.gain.exponentialRampToValueAtTime(0.01, now + 0.35);
osc.connect(gain);
gain.connect(this.ctx.destination);
osc.start(now);
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();
}
init() {}
playSuccess() {}
playCoin() {}
playScanChirp() {}
playError() {}
playTap() {}
playBeep() {}
playNotice() {}
playTrash() {}
}
window.sounds = new SoundEffects();
const silentInstance = new SoundEffects();
// Proxy de seguridad para asegurar que cualquier llamada desconocida sea silenciosa y segura
window.sounds = new Proxy(silentInstance, {
get(target, prop) {
if (prop in target) {
return target[prop];
}
return function() {};
}
});
+2 -33
View File
@@ -450,34 +450,8 @@
let lastScannedToken = null;
let lastScannedTime = 0;
let sseSource = null;
let audioCtx = null;
// Inicializar Audio Web sintético (beeper de pistola POS)
function playLaserBeep() {
try {
if (!audioCtx) {
audioCtx = new (window.AudioContext || window.webkitAudioContext)();
}
if (audioCtx.state === 'suspended') {
audioCtx.resume();
}
const osc = audioCtx.createOscillator();
const gain = audioCtx.createGain();
// Tono agudo característico de pistola lectora de supermercado (2400Hz)
osc.type = 'sine';
osc.frequency.setValueAtTime(2400, audioCtx.currentTime);
gain.gain.setValueAtTime(0.35, audioCtx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.01, audioCtx.currentTime + 0.08);
osc.connect(gain);
gain.connect(audioCtx.destination);
osc.start();
osc.stop(audioCtx.currentTime + 0.08);
} catch (e) {
console.warn('Audio feedback error:', e);
}
}
// Inicializar Audio Web sintético (beeper de pistola POS) - DESACTIVADO
function playLaserBeep() {}
// Vibración háptica
function vibratePhone() {
@@ -719,11 +693,6 @@
window.addEventListener('DOMContentLoaded', () => {
initSSEConnection();
startScannerCamera();
// Desbloquear AudioContext al primer toque
document.body.addEventListener('click', () => {
if (!audioCtx) playLaserBeep();
}, { once: true });
});
</script>
</body>
+3 -3
View File
@@ -673,10 +673,10 @@
</div>
</div>
<script src="/js/dialogs.js?v=13.7"></script>
<script src="/js/sounds.js?v=9.6"></script>
<script src="/js/dialogs.js?v=13.8"></script>
<script src="/js/sounds.js?v=13.8"></script>
<script src="/js/jsQR.js"></script>
<script src="/js/food-icons.js?v=1.1"></script>
<script src="/js/pos.js?v=13.7"></script>
<script src="/js/pos.js?v=13.8"></script>
</body>
</html>
+2 -2
View File
@@ -1,5 +1,5 @@
// SiboPay PWA Service Worker v13.7 - Modal Ver Motivo de Rechazo SINPE en Portal de Padres
const CACHE_NAME = 'sibopay-v13.7';
// SiboPay PWA Service Worker v13.8 - Sonidos desactivados en toda la aplicación
const CACHE_NAME = 'sibopay-v13.8';
const STATIC_ASSETS = [
'/',
'/index.html',