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

302
Vistas
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
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