【问题标题】:Watson Text to Speech blankWatson 文本转语音空白
【发布时间】:2016-08-28 00:47:19
【问题描述】:

我有一个使用 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);

【问题讨论】:

    标签: text-to-speech ibm-watson


    【解决方案1】:

    这是因为--output 'test.wav' 标志:音频文件被保存到test.wav,而不是通过标准输出传递到$result。

    【讨论】:

      猜你喜欢
      • 2019-04-22
      • 2019-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多