Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
Text to speach automatically calls Speak Function in react-speech-kit

I'm trying to create a speech-to-text command then the server will reply as text then convert it to speech using react-speech-kit. Both function works fine, but what I wanted to do is call the Speak() function from useSpeechSynthesis automatically.

I've called the speak function on onEnd function from useSpeechRecognition like this

  const onEnd = () => {
    fetch(
      "http://api/Main?id=test&lang=kor&req=" +
        value,
      {}
    )
      .then((res) => res.json())
      .then(
        (result) => {
          setResponse(result.res);
          speak(result.res);
          console.log(result);
        },
        (error) => {
          console.log(error);
        }
      );
    // You could do something here after speaking has finished
  };

But it doesn't speak for itself after the value has been passed.

Does anyone know how to make it automatic?

EDIT

I was wrong to call speak function like that, it should've be like this speak({text:result.res}); It is working now, TTS automatically calls, but it calls over and over again, not once, anyone knows how to fix it?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!