WaveNet is used in Cloud text-to-speech for TTS, which has a demo on the page. Currently a beta version
How to use
- Registration and Certification reference: Quickstart:text-to-speech
- Install the Python library for Google Clould
- Install Google Cloud Text-to-Speech API Python dependency (Dependencies), see GitHub instructions
- ----included, install PIP install google-cloud-texttospeech==0.1.0
To implicit the call, set the environment variable google_application_credentials to your API Key (JSON file) and reboot after completion
Python script: Text to mp3
# [START tts_synthesize_text]def Synthesize_text (text): "" "" " synthesizes speech from the input string of text. " "" From Google.cloud import texttospeech client = Texttospeech. Texttospeechclient () input_text = Texttospeech.types.SynthesisInput (text=text) # note:the voice can also be specified by name. # Names of voices can is retrieved with Client.list_voices (). Voice = Texttospeech.types.VoiceSelectionParams ( language_code= ' en-us ', ssml_gender= Texttospeech.enums.SsmlVoiceGender.FEMALE) audio_config = Texttospeech.types.AudioConfig ( audio_ Encoding=texttospeech.enums.audioencoding.mp3) response = Client.synthesize_speech (Input_text, voice, Audio_ config) # The response ' s audio_content is binary. With open (' Output.mp3 ', ' WB ') as Out: out.write (response.audio_content) print (' audio content written to file "Output.mp3" ') # [END Tts_synthesize_text]
WaveNet characteristics
6 Types of voice type currently supported
Parameter description
Https://cloud.google.com/text-to-speech/docs/reference/rest/v1beta1/text/synthesize#audioconfig
Using WaveNet with Google Cloud API