Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

219
Vistas
¿Es posible hacer que la voz en html TTS no cambie cada vez que se usa?

Quiero hacer un asistente de voz de IA en un sitio web html, sin embargo, también quiero que solo hable con una sola voz , cada vez que ejecuto el código (a continuación) siempre tengo la voz cambiando. Quiero que la voz sea estática y no cambie.

 const btn = document.querySelector('.talk'); const content = document.querySelector('.content'); // const hru = ['I am fine', "I feel fine"]; const hello = ['Hi', 'Hello', 'Hey']; const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition; const recognition = new SpeechRecognition(); recognition.onstart = function () { console.log('Voice is activated, you can use the microphone'); }; recognition.onresult = function(event){ const current = event.resultIndex; const transcript = event.results[current][0].transcript; content.textContent = transcript; readOutLoud(transcript) }; // add the listener to the btn btn.addEventListener('click', () =>{ recognition.start(); }); function readOutLoud(message){ const speech = new SpeechSynthesisUtterance(); speech.text = 'What did you say?'; if(message.includes('how are you')){ const finalhru = hru[Math.floor(Math.random() * hru.length)]; speech.text = finalhru; } if(message.includes('hello', 'hi', 'hey')){ const finalhello = hello[Math.floor(Math.random() * hello.length)]; speech.text = finalhello; } speech.volume = 1; speech.rate = 1; speech.pitch = 1; window.speechSynthesis.speak(speech) }
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda