沃森文本到语音空白

时间:2016-08-28 00:47:20

标签: text-to-speech ibm-watson

我使用Watson Text to Speech的简单示例,但即使使用示例,音频返回的文件也始终为空白。

我的代码:

$result = shell_exec("/usr/bin/curl -k -u 'xxxx':'xxxx' -X POST \
  --header 'Content-Type: application/json' \
  --header 'Accept: audio/wav' \
  --output 'test.wav'  \
  --data '{\"text\":\"hello world\", \"voice\":\"en-US_AllisonVoice\"}' \
  'https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize/'");
print_r($result);

1 个答案:

答案 0 :(得分:0)

由于--output 'test.wav'标志的原因:音频文件正在保存到test.wav,而不是通过stdout传递给$ result。

相关问题