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.