有没有办法在DialogFlow(Api.ai)的对话过程中将女性语音转换为男性语音 [英] Is there a way to have change female to male voice during the conversation in DialogFlow (Api.ai)

查看:102
本文介绍了有没有办法在DialogFlow(Api.ai)的对话过程中将女性语音转换为男性语音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用Api.ai(现为Dialogflow)为Google Home构建了一个聊天机器人应用,该应用同时具有男性和女性的历史人物。我们正在Google上使用Action。 Google允许您在部署应用程序时默认使用男性或女性声音。有没有办法动态地在男声和女声之间切换,例如在webhook中使用代码?

We a building a chatbot app for Google Home using Api.ai (Dialogflow now) which has both male and female historical figures. We are using Actions on google. Google lets you default to a male or female voice when deploying the app. Is there a way to switch between male to female voice dynamically, for example, using code in webhook?

推荐答案

也许。尽管 SSML 支持< voice> 标记,Actions文档未将其列出为受支持的。但是,正如您指出的那样,似乎有一些支持。 variant 属性似乎有效,至少在美国是这样。 语言属性似乎没有。所以类似的事情可能会起作用:

Maybe. Although SSML supports a <voice> tag, the documentation for Actions does not list it as supported. However, as you noted, there appears to be some support. The gender and variant attributes seem to work, at least for en-US. The languages attribute doesn't seem to be. So something like this might work:

<speech>
    <voice gender="male" variant="1">male</voice>
    <voice gender="male" variant="2">male</voice>
    <voice gender="female" variant="1">female</voice>
    <voice gender="female" variant="2">female</voice>
</speech>

但是记录为工作的 是使用< prosody> SSML标签。这是一个示例,您可以用来查看改变音高后的声音:

However what is documented as working is to adjust the pitch of the default voice (whichever one you pick) using the <prosody> SSML tag. Here is an example you can use to see how it sounds if you vary the pitch:

<speech>
    test
    <prosody pitch="-1st">test</prosody>
    <prosody pitch="-2st">test</prosody>
    <prosody pitch="-3st">test</prosody>
    <prosody pitch="-4st">test</prosody>
    <prosody pitch="-5st">test</prosody>
    <prosody pitch="-6st">test</prosody>
    <prosody pitch="-7st">test</prosody>
    <prosody pitch="-8st">test</prosody>
    <prosody pitch="-9st">test</prosody>
    <prosody pitch="+1st">test</prosody>
    <prosody pitch="+2st">test</prosody>
    <prosody pitch="+3st">test</prosody>
    <prosody pitch="+4st">test</prosody>
    <prosody pitch="+5st">test</prosody>
    <prosody pitch="+6st">test</prosody>
    <prosody pitch="+7st">test</prosody>
    <prosody pitch="+8st">test</prosody>
    <prosody pitch="+9st">test</prosody>
</speech>

您也可以将两个标签组合在一起。

You can also combine the two tags.

这篇关于有没有办法在DialogFlow(Api.ai)的对话过程中将女性语音转换为男性语音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆