AI & ML interests

class VoiceQueueManager { constructor() { self.queue = []; self.isSpeaking = false; self.synth = window.speechSynthesis; } // Adiciona mensagem com nível de prioridade (1 = Alta, 2 = Normal) addToQueue(text, type) { const priority = (type === 'Emergency' || type === 'Sale') ? 1 : 2; const message = { text, type, priority }; if (priority === 1) { // Se for emergência ou venda, vai para a frente da fila this.queue.unshift(message); if (this.isSpeaking) { this.synth.cancel(); // Interrompe a fala atual para dar a notícia urgente } } else { this.queue.push(message); } this.processQueue(); } processQueue() { if (this.isSpeaking || this.queue.length === 0) return; this.isSpeaking = true; const nextMsg = this.queue.shift(); const utterance = new SpeechSynthesisUtterance(nextMsg.text); // Configuração da Voz Masculina const voices = this.synth.getVoices(); utterance.voice = voices.find(v => v.name.includes('Google português do Brasil')) || voices[0]; utterance.pitch = 0.8; // Tom mais grave/masculino utterance.rate = 1.1; utterance.onend = () => { this.isSpeaking = false; this.processQueue(); }; this.synth.speak(utterance); } } export const voiceManager = new VoiceQueueManager();

Organization Card

Edit this README.md markdown file to author your organization card.

models 0

None public yet

datasets 0

None public yet