Jyoti Thakur
Jyoti Thakur

Reputation: 27

Why I am facing some problem with voice RSS api

I am using Voice RSS api for text to speech, I am facing some problems with this api

this is my code

When try to say Hi or Hello in microphone it works on fine , but with other sentence it dose not reply

 if( itsValue == 'what is your name' || itsValue == 'may I have your name' || itsValue == 'how may I address you' || itsValue == 'who are you' || itsValue == 'may I know your name' || itsValue == 'how can I call you'){
              alert('df')
              var text = encodeURIComponent("Opening...please wait");
              document.getElementById("voiceresult").setAttribute("src", audioUrl+text);
              document.getElementById("voiceresult").play();
            } 

Upvotes: 0

Views: 392

Answers (1)

Nino Filiu
Nino Filiu

Reputation: 18533

Here's why the error happens: raw.githubusercontent.com is serving your JavaScript file as plaintext (text/plain instead of application/javascript). Your browser have strict MIME type checking enabled, so it throws an error, because it asks for some JavaScript but receives what appears to be plaintext.

Unfortunately, you don't have any control over raw.githubusercontent.com, so you have two solutions:

  • Disable strict MIME type checking on your browser
  • Use an alternative to raw.githubusercontent.com, like jsdelivr

Upvotes: 1

Related Questions