在行动中改变声音

时间:2017-07-31 07:53:43

标签: actions-on-google ssml

如何在“Google上的操作”中回复时更改语音?是否有SSML代码暂时改变声音,例如,从男性到女性,同时阅读报价?

3 个答案:

答案 0 :(得分:5)

您实际上可以通过在speak标签内添加语音标签来改变语音。你可以尝试这样的事情:

<speak><voice gender="female">Hello I'm Mary</voice><break time="2s"/><voice gender="male">Hey I'm John</voice><speak>

答案 1 :(得分:0)

此刻您无法更改语音,但您可以使用语音合成标记语言(SSML)来获得更多可自定义(=音频)响应。

有关如何在Google上采取行动使用SSML的更多信息:https://medium.com/google-developers/ssml-for-actions-on-google-946117f97fd1

我希望它有所帮助。

答案 2 :(得分:0)

最佳解决方案。

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' },
  };

这对我来说就像是魅​​力

相关问题