在 Dialogflow 中返回音频

Returning Audio in Dialogflow

我正在使用 dialogflow 和我当前的脚本return代理的响应以文本格式通过:content.queryResult.fulfillmentText; 我还想 return 合成音频响应,我正在使用 Dialogflow API.v2。

如果您转到 Dialogflow 代理中的设置,在 "Speech" 选项卡中,您可以打开 "Enable Automatic Text to Speech" 选项以始终为对话生成音频。

此外,您还可以调整更多设置来控制语音配置。

您还可以使用 outputAudioConfig parameter in the DerectIntentRequest.

在每个请求的基础上设置此配置

终于可以找到audioOutput in the DetectIntentResponse.