net - UK (2020-04)

(Antfer) #1

Text-to-Speech API


Top Using the Google
Cloud Platform Console,
create or select a Google
Cloud Project
Above Browse the Google
Cloud Platform API library
and enable the Text-to-
Speech API

simple, the complexity of making a sound human-
like requires vast amounts of AI training. DeepMind
has developed groundbreaking technology called
WaveNet that can create extremely human-sounding
voices. Combining this with neural networks yields
an increasing range of voices and options.


S20(.(<)($785(62)63((&+
SYNTHESIS
O Multi-language support
O Playback rate to adjust how fast or slow a voice is
O Pitch control to set the right style voice for your app
O Volume control to fine-tune for various scenarios
O Device-specific profiles to target hardware for
optimal playback


S3((&+6<17+(6,6:,7+22/(ş6
7(;77263((&+$3,
With many great choices of tools and APIs, it can
be hard to know what tool to use but, for this
tutorial, we’ve chosen to focus on Google’s. Google
Cloud Text-to-Speech is one of the most advanced
options currently available. It uses a Restful API
model, enabling you to access it from a wide
range of platforms and languages. It is capable of
producing over 180 different voices, spanning over 30
languages. It combines the DeepMind WaveNet tech
with Google’s own machine learning. The results can
be returned in multiple formats, as well as be device-
specific for optimal playback results.
When you combine this API with others within the
Google ecosystem, you can create powerful solutions
all under one project. It makes it a great choice for
this task and is valuable learning, regardless of what
tools you use in projects ahead.


STEP 1:6(783$ 22/(
&/28'352-(&7
To get started, you’ll need to set up a Google Cloud
project. Go to the Google Cloud Platform Console
(https://console.cloud.google.com/) to create a new
project. Or select an existing one, if you want to add
this feature to a project you are working on.
The Text-to-Speech API is free to use until you
start needing to process millions of characters per
month. For this service you may need to associate
billing info with your account when you activate
the API, if you haven’t before. You can remove the
services after you are done testing and it’s not
charged at low volume usage.


STEP 2: ACTIVATE THE
7(;77263((&+$3,
Next, go to the Google API library and select the
Text-to-Speech API for your project. If you are


having trouble finding it, the URL for it is: https://
console.cloud.google.com/apis/library?project=text-to-
speech-265814&q=Text
Click on the Text-to-Speech API and then click on
the Enable button. Once enabled you will see a little
green check and the message API Enabled beside it.
It’s now added to your project.

STEP 3:&5($7($6(59,&($&&2817
$1'$''&5('(17,$/6
The API works as a web service. So you will need
to set up a service account that is authenticated to
use it. If you are having trouble finding the page
where you add the service, here is the direct URL:
https://console.cloud.google.com/iam-admin/
serviceaccounts. Once there, select your project,
if it’s not already selected, and then click Create
Service Account. Give a name to your new service
and leave the role unselected.
After pressing Create, you’ll be prompted to
proceed without a role. You don’t need a role for this
type of service, so this is what you want. Click that
option to create it.

STEP 4:'2:1/2$'$1'6725(<285
35,9$7(.(<
Once you create your service account, it automatically
downloads your private key as a JSON file. Take note
of the location of the file, so you can use it in the
next steps.
Free download pdf