javascript - 使用反应文本到语音
问题描述
我正在使用来自此链接https://www.readspeaker.com/text-to-speech-demo/的名为 read speaker 的服务使用以下代码进行文本到语音:
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);
})
出于某种原因,响应显示如下: 错误:未指定密钥或指定无效密钥,但我提供了正确的 api 密钥。
删除方法时:'POST' 我得到以下响应:
body: (...)
bodyUsed: false
headers: Headers {}
ok: false
redirected: false
status: 0
statusText: ""
type: "opaque"
url: ""
我不知道该怎么做或有什么问题!
解决方案
推荐阅读
- c# - C# DataGridView 选择模式:单元格选择 - 是否可以检索该选定行的特定列值?
- android - Flutter 天气应用中的城市选择 - Flutter
- mysql - 合并两张表,使用先进先出排序
- android - 为什么 Android App Links 的自动验证失败
- java - 如何过滤 2 个巨大的列表,其中包含数百万个具有相同 ID 的项目
- image - 如何调整图像大小 woocommerce oceanwp
- python - 安装 pyinstaller 的错误
- c# - 退出时的 Visual Studio Code 会杀死附加了 C# 调试器的外部 .exe 进程
- angular - 在 karma 中测试订阅会给出错误“Observable<>”类型的参数不能分配给“订阅”类型的参数
- image - 将小部件放置在图像内的精确坐标中