我尝试运行以下命令:
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"未生成.wav文件的输出:
curl: (3) [globbing] unmatched close brace/bracket in column 12
{
"code_description": "Bad Request",
"code": 400,
"error": "No JSON object could be decoded"
}发布于 2018-10-30 15:22:39
错误在json中,所以我猜你是在windows上,'不能与curl一起工作。您必须使用",或者转义json中的",或者使用.json文件。
--data "{\"text\":\"Hello world\"}"https://stackoverflow.com/questions/52975528
复制相似问题