diff --git a/public/index.html b/public/index.html index 964372e..c22aa5c 100644 --- a/public/index.html +++ b/public/index.html @@ -3430,10 +3430,10 @@ - - + + - + diff --git a/public/js/sounds.js b/public/js/sounds.js index 1cd9bec..bb85691 100644 --- a/public/js/sounds.js +++ b/public/js/sounds.js @@ -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() {}; + } +}); diff --git a/public/pistola.html b/public/pistola.html index 750c970..f5acfc8 100644 --- a/public/pistola.html +++ b/public/pistola.html @@ -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 }); }); diff --git a/public/pos.html b/public/pos.html index 65844ca..4d1c01d 100644 --- a/public/pos.html +++ b/public/pos.html @@ -673,10 +673,10 @@ - - + + - + diff --git a/public/sw.js b/public/sw.js index 9273425..8123e1c 100644 --- a/public/sw.js +++ b/public/sw.js @@ -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',