简体   繁体   English

为什么我在语音RSS API上遇到一些问题

[英]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 我正在使用语音RSS API进行文本到语音的转换,此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();
            } 

Here's why the error happens: raw.githubusercontent.com is serving your JavaScript file as plaintext ( text/plain instead of application/javascript ). 这是发生错误的原因: raw.githubusercontent.com将JavaScript文件作为纯文本( text/plain而不是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. 您的浏览器已启用严格的MIME类型检查,因此会引发错误,因为它要求使用一些JavaScript,但收到的内容似乎是纯文本。

Unfortunately, you don't have any control over raw.githubusercontent.com , so you have two solutions: 不幸的是,您对raw.githubusercontent.com没有任何控制权,因此有两种解决方案:

  • Disable strict MIME type checking on your browser 在浏览器上禁用严格的MIME类型检查
  • Use an alternative to raw.githubusercontent.com , like jsdelivr 使用raw.githubusercontent.com的替代raw.githubusercontent.com ,例如jsdelivr

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我在 JavaScript/ReactJS 中遇到问题 - I am facing a problem in JavaScript/ReactJS 我面临问题引导表响应 - I am facing problem bootstrap table responsive 想显示投资组合图片,但我遇到了一些错误 - want to show portfolio images but i am facing some error 我面临安装 react-currency-format 的问题? - I am facing the problem to install react-currency-format? 我在将服务数据推送到ANGULAR中的数组时遇到问题 - I am facing problem in pushing my service data to the Array in ANGULAR "我在 React Native 中遇到了关于异步存储的问题" - i am facing a problem regarding async storage in react native 我在使用 javascript 数组时遇到了一个困难且关键的问题? - I am facing a difficult and critical problem with javascript array? 我在 Javascript 中链接异步代码时遇到问题 - I am facing problem chaining the async code in Javascript 建立应用程式后,我在android studio中遇到错误,该怎么办? - I am facing some errors in android studio after building the app, What can I do? 我正在使用 useEffect 来点击 api 并返回一些响应来显示它。为什么会发生这个错误 - I am using useEffect to hit api and return some response to display it.why this error is happening
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM