feat(audio): desactivar completamente todos los sonidos de la aplicacion y del inicio de sesion
This commit is contained in:
+3
-3
@@ -3430,10 +3430,10 @@
|
|||||||
</button>
|
</button>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<script src="/js/dialogs.js?v=13.7"></script>
|
<script src="/js/dialogs.js?v=13.8"></script>
|
||||||
<script src="/js/sounds.js?v=9.6"></script>
|
<script src="/js/sounds.js?v=13.8"></script>
|
||||||
<script src="/js/jsQR.js"></script>
|
<script src="/js/jsQR.js"></script>
|
||||||
<script src="/js/food-icons.js?v=1.1"></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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+22
-142
@@ -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 {
|
class SoundEffects {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.ctx = null;
|
this.ctx = null;
|
||||||
|
this.enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {}
|
||||||
if (!this.ctx) {
|
playSuccess() {}
|
||||||
const AudioCtx = window.AudioContext || window.webkitAudioContext;
|
playCoin() {}
|
||||||
this.ctx = new AudioCtx();
|
playScanChirp() {}
|
||||||
}
|
playError() {}
|
||||||
if (this.ctx.state === 'suspended') {
|
playTap() {}
|
||||||
this.ctx.resume();
|
playBeep() {}
|
||||||
}
|
playNotice() {}
|
||||||
|
playTrash() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sonido de escaneo exitoso / cobro completado (Tono alegre ascendente)
|
const silentInstance = new SoundEffects();
|
||||||
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';
|
// Proxy de seguridad para asegurar que cualquier llamada desconocida sea silenciosa y segura
|
||||||
osc2.type = 'sine';
|
window.sounds = new Proxy(silentInstance, {
|
||||||
|
get(target, prop) {
|
||||||
// Acorde alegre de confirmación: C5 -> E5 -> G5
|
if (prop in target) {
|
||||||
osc1.frequency.setValueAtTime(523.25, now);
|
return target[prop];
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
return function() {};
|
||||||
}
|
}
|
||||||
|
});
|
||||||
// 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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
window.sounds = new SoundEffects();
|
|
||||||
|
|||||||
+2
-33
@@ -450,34 +450,8 @@
|
|||||||
let lastScannedToken = null;
|
let lastScannedToken = null;
|
||||||
let lastScannedTime = 0;
|
let lastScannedTime = 0;
|
||||||
let sseSource = null;
|
let sseSource = null;
|
||||||
let audioCtx = null;
|
// Inicializar Audio Web sintético (beeper de pistola POS) - DESACTIVADO
|
||||||
|
function playLaserBeep() {}
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vibración háptica
|
// Vibración háptica
|
||||||
function vibratePhone() {
|
function vibratePhone() {
|
||||||
@@ -719,11 +693,6 @@
|
|||||||
window.addEventListener('DOMContentLoaded', () => {
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
initSSEConnection();
|
initSSEConnection();
|
||||||
startScannerCamera();
|
startScannerCamera();
|
||||||
|
|
||||||
// Desbloquear AudioContext al primer toque
|
|
||||||
document.body.addEventListener('click', () => {
|
|
||||||
if (!audioCtx) playLaserBeep();
|
|
||||||
}, { once: true });
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+3
-3
@@ -673,10 +673,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/js/dialogs.js?v=13.7"></script>
|
<script src="/js/dialogs.js?v=13.8"></script>
|
||||||
<script src="/js/sounds.js?v=9.6"></script>
|
<script src="/js/sounds.js?v=13.8"></script>
|
||||||
<script src="/js/jsQR.js"></script>
|
<script src="/js/jsQR.js"></script>
|
||||||
<script src="/js/food-icons.js?v=1.1"></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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// SiboPay PWA Service Worker v13.7 - Modal Ver Motivo de Rechazo SINPE en Portal de Padres
|
// SiboPay PWA Service Worker v13.8 - Sonidos desactivados en toda la aplicación
|
||||||
const CACHE_NAME = 'sibopay-v13.7';
|
const CACHE_NAME = 'sibopay-v13.8';
|
||||||
const STATIC_ASSETS = [
|
const STATIC_ASSETS = [
|
||||||
'/',
|
'/',
|
||||||
'/index.html',
|
'/index.html',
|
||||||
|
|||||||
Reference in New Issue
Block a user