Можно ли протестировать речевой голос Google Cloud в консоли действий Dialogflow? - PullRequest
0 голосов
/ 03 ноября 2018

Я хочу использовать голос WaveNet для своего агента Dialogflow для Google Assistant вместо стандартного роботизированного голоса TTS. Поэтому я наткнулся на эту статью .

Как я понимаю, можно получить выходной аудиофайл с ответом бота голосом WaveNet, но было бы также неплохо услышать этот голос в консоли действий Dialogflow или в моем Google Home. Возможно ли услышать другой голос в консоли, чем обычный голос TTS?

1 Ответ

0 голосов
/ 06 ноября 2018

Вы можете использовать SSML с Dialogflow, чтобы прикреплять свои собственные файлы .ogg.

Google предоставляет пример использования Github , если вам интересно. Код прилагается:

<speak>
  The key element for layered sound mixing is <sub alias="par">${'<par>'}</sub>
  (as in "parallel") which inserts a mixed sound at the current point of the TTS.
  It is similar to the <sub alias="paragraph">${'<p>'}</sub>
  element with an important difference of not displaying
  the text content in chat bubbles on surfaces with displays.
  <par>
    <media xml:id="first_thing" begin="2.5s">
      <speak>
        This media element contains a <sub alias="speak element">${'<speak>'}</sub> for TTS.
        It has an <say-as interpret-as="verbatim">xml:id</say-as> attribute so that other
        <sub alias="media">${'<media>'}</sub> elements can refer to it.
        There is also a "begin" attribute that delays the start time by 2.5 seconds.
        Millisecond units are also supported by the
        <say-as interpret-as="letters">ms</say-as> suffix.
      </speak>
    </media>
    <media xml:id="second_thing" soundLevel="-1dB" repeatCount="3">
      <audio src="https://actions.google.com/sounds/v1/cartoon/cartoon_boing.ogg">
        The sound source for this <sub alias="audio">${'<audio>'}</sub> element is missing.
        Find more sounds at https://developers.google.com/actions/tools/sound-library.
      </audio>
    </media>
    <media xml:id="last_thing" begin="first_thing.end + 1234ms">
      <speak>
        This TTS starts <say-as interpret-as="units">1234 milliseconds</say-as>
        after the end of the media element with the
        <say-as interpret-as="verbatim">xml:id</say-as> equal to "first_thing".
      </speak>
    </media>
  </par>
</speak>
...