Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

227
Visualizações
Speech Recognition Microphone is not working

Can you please tell me why my microphone is not working ? When I made some correction in app.js file I can see microphone is blinking twice and then is death. I believe microphone is on. Any suggestion how to fix this problem ? Thank you

here is my code:

const msgEl = document.getElementById('msg')

window.SpeechRecognition = window.SpeechRecognition ||
window.webkitSpeechRecognition;

let recognition = new window.SpeechRecognition()


// start recognition
recognition.start();

function onSpeak(e) {
  const msg = e.results[0][0].transcript;
  console.log(msg)
  
}

recognition.addEventListener('result', onSpeak);

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

It's working, but by default, the recognition service is not continuous, it will end after a single result or timeout. So if you need continuous results you should set the property as false:

let recognition = new window.SpeechRecognition()
recognition.continuous = true;

But now the new results will be appended to the recognition list everytime there is a new result, so you will have to modify the way you print the results:

function onSpeak(e) {
    let msg = e.results[e.results.length-1][0].transcript;
    console.log(msg)
}

And if you do not want it to end on timeout if there is no activity, you may try this:

recognition.onend = function() {
    console.log('Speech recognition has stopped. Starting again ...');
    recognition.start();
}

References:

https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/continuous

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda