我如何在“在Google上的行动”的回应中改变声音?有没有SSML代码可以在读引文时临时改变声音,例如,从男性变成女性?
发布于 2017-08-18 03:15:01
实际上,您可以通过在speak标签中添加声控标签来更改语音。您可以尝试如下所示:
<speak><voice gender="female">Hello I'm Mary</voice><break time="2s"/><voice gender="male">Hey I'm John</voice><speak>发布于 2017-08-03 00:58:08
你现在不能改变声音,但是你可以使用语音合成标记语言(SSML),以获得更多可定制的(=音频)响应。
有关如何在谷歌上使用SSML和Action的更多信息,请访问:https://medium.com/google-developers/ssml-for-actions-on-google-946117f97fd1
我希望它能帮上忙。
发布于 2019-03-08 07:27:27
这是最好的解决方案。
const request = {
// The text to synthesize
input: {
ssml:`<speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/10/synthesis
http://www.w3.org/TR/speech-synthesis11/synthesis.xsd"
xml:lang="en-US">
<voice gender="female" languages="en-US" required="languages gender variant">It Maria and this is my female voice,</voice>
<!-- processor-specific voice selection -->
<voice name="Mike" required="name">Its Mike and its my male voice</voice>
</speak>`
},
// The language code and SSML Voice Gender
voice: { languageCode: 'en-US', ssmlGender: 'NEUTRAL' },
// The audio encoding type
audioConfig: { audioEncoding: 'MP3' },
};这对我来说就像一个护身符
https://stackoverflow.com/questions/45410224
复制相似问题