IBM Watson TTS 示例 return 空白音频文件

IBM Watson TTS example return a blank audio file

我在使用 IBM 使用 cURL 提供的 Watson TTS 示例时遇到了一些问题:

curl -X POST -u {USERNAME}:{PASSWORD} \
--header "Content-Type: application/json" \
--header "Accept:  audio/wav" \
--data '{"text":"hello world"}' \
--output hello_world.wav \
"https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize"

我是通过 GitBASH 运行 这个 cURL 命令,但我得到的音频文件输出是空白的,不包含任何音频。

我试过改变:

--data '{"text":"hello world"}' \

至:

--data "{\"text\":\"hello world\"}" \

但我得到了相同的结果。

删除您的用户名和密码凭据周围的 {},顺便说一句,它们现在已被泄露。

您应该撤销这些凭据并创建一组新的凭据,您应该尽量保密而不是 post 在 public 论坛中。