MIKE BIFULCO: Conversational actions
allow you to create a rich, multimodal experience
for your app or service with Google Assistant.
Creating a great conversational experience is always the goal.
And Action Builder offers many helpful features
to create a conversational action that
can feel like a real conversation with Assistant.
Hi there.
I'm Mike from the Google Assistant Developer Relations
team.
Today I'm going to talk about SSML features
for conversational actions and how you can take advantage
of some of the features within SSML to make
your conversational apps that much smoother.
So let's start with the basics.
What is SSML?
SSML stands for Speech Synthesis Markup Language.
It allows us to specify how text is pronounced
when using Assistant's text-to-speech features.
SSML is an industry-wide standard
that is governed by the World Wide Web Consortium, or W3C.
SSML is an XML-based markup language,
and will look pretty familiar if you've
written XML or HTML or anything like that before.
At its most basic, SSML allows you to supply text
to a text-to-speech generator, producing a sound file speaking
the contents of your text.
Let's take a look at a quick example.
MALE GOOGLE ASSISTANT: Once upon a time,
in a little house in the woods--
MIKE BIFULCO: Pretty cool, right?
Without much effort, this sample pauses
when it gets to the comma, and even trails off
a bit when it gets to the ellipses
at the end of the sentence.
If you've built a conversational action before,
you may have bumped into SSML once or twice.
There's many additional features specified
in SSML, which can help you add depth and character to speech
voiced by the Assistant.
MALE GOOGLE ASSISTANT: Once upon a time,
in a little house in the woods, there
was a little family making their dinner.
MIKE BIFULCO: We've recently added
support for a couple new SSML features to Assistant.
Let's take a look at a few of those features.
First up, the phoneme tag.
This allows you to customize the pronunciation
of specific words.
This can be useful when you want the Assistant to pronounce
a certain word just so, or if your app is
used by people in different regions
where the same word can have a markedly
different pronunciation.
To do this, you'll wrap the word whose pronunciation you
want to specify in the phoneme tag,
and supply two parameters to the tag, alphabet and ph.
The alphabet parameter is used to specify
the phonetic alphabet you want to use to declutter
your pronunciation.
You've got two options here-- ipa, for the International
Phonetic Alphabet, and x-sampa, which
is the Extended Speech Assessment Methods Phonetic
Alphabet.
These are both industry standards which
are used to describe phonetics.
One caveat here, if you're using text-to-speech
for the Chinese language, the options for alphabet
are pinyin and jyut ping.
There are more details on this in the docs
if you're interested.
The other parameter to supply is ph,
which is where you supply the phonetic spelling of the word
that's being processed.
For more information on what's available here,
check out our docs on supported phonemes and levels of stress.
So let's take a look at a classic case where
you might want to use the tag.
You may have heard this old gem before.
MALE GOOGLE ASSISTANT: You say tomato and I say tomato.
MIKE BIFULCO: Actually, that's not right at all.
But let's not call the whole thing off.
With a little bit of phoneme magic,
it'll sound just like this.
MALE GOOGLE ASSISTANT: You say tomato and I say "to-mah-to."
MIKE BIFULCO: Perfect.
Now the Assistant can say it the way your audience expects,
so you can go your way and I'll go mine.
Up next, the duration tag--
to tell the interpreter to read something
as a duration of time, wrap the time measurement
in a say-as tag.
You'll supply a parameter called interpret-as with duration,
and a format string to tell the interpreter how
to read the number.
MALE GOOGLE ASSISTANT: Shelly finished the half marathon
in two hours and 23 minutes.
MIKE BIFULCO: Now, when your SSML is interpreted,
the text-to-speech engine will treat it
as a duration rather than an ordinal number.
Until recently, Assistant's SSML engine
would only generate speech in a single voice per call.
With the recent addition of support for the voice tag,
you can generate audio in multiple voices
and multiple languages in one SSML file.
Let's check that out.
MALE GOOGLE ASSISTANT: Good morning, friend.
FEMALE GOOGLE ASSISTANT 1: Good morning, friend.
FEMALE GOOGLE ASSISTANT 2: Buenos dias, amiga.
MIKE BIFULCO: There's many options which you can use here
for voice and language.
Jump into the docs for more on the specifics.
Similarly, we've added support for the lang tag, which
allows you to use the same voice in a different language
for a subset of your SSML text.
Let's take a look at how you might use the lang tag.
MALE GOOGLE ASSISTANT: All right,
here's some places with great croque madame in Boston.
MIKE BIFULCO: Great.
So those are some of the great new features
which are supported in conversational actions
for Google Assistant.
For more information, head on over to the docs.
Thanks so much for watching.
If you have any questions or if you
want to see what everyone else is building,
join us on Reddit at r/GoogleAssistantDev,
or follow @ActionsOnGoogle on Twitter.
Hope to see you there.