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

305
Views
how to make text to speech in react js

I am using 'google-tts-api' to change text to speech in my react app.

const speech = () => {
    let str = document.getElementById("content" + props.id).innerHTML;

    const results = getAllAudioUrls(str, {
      lang: "my",
      slow: false,
      host: "https://translate.google.com",
      splitPunct: ". ",
    });
    setTracks(results);
  };

'results' is array of objects. It changes long text (>200 char) into short text. That's why 'results' has a lot of objects urls.
My problem is those urls. When I copy and paste in browser, the url shows audio file and plays it. But when I use in my react app, it cannot play. I tried with '', '', ''. In 'iframe', it shows 404 error. Even if I used with url, it is opened as 404 error.

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!