text to speech using react

984 views Asked by At

I am using a service called read speaker from this link https://www.readspeaker.com/text-to-speech-demo/ for text to speech using the following code:

 fetch('https://tts.readspeaker.com/a/speak?key=xxx&lang=sv_fi&voice=Samuel&text=veta', {
            method: 'get',
            // headers: {
            //     'Content-Type': 'application/json'
            // },
            mode: 'no-cors'

        })
            .then(response => {
                 console.log("RESPONSE: ", response);
            })
            .catch(error => {
                console.log("ERROR: ", error);
            })

For some reason the response shows this: ERROR: No or invalid key specified thou I am giving the right api key.

When removing method: 'POST' I get the following response:

body: (...)
bodyUsed: false
headers: Headers {}
ok: false
redirected: false
status: 0
statusText: ""
type: "opaque"
url: ""

I have no idea what to do or what is the issue!

0

There are 0 answers