Reputation: 27
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
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:
raw.githubusercontent.com
, like jsdelivrUpvotes: 1