Cloud Text-to-Speech 中使用了WaveNet,用于TTS,页面上有Demo。目前是BETA版

使用方法

  • 注册及认证参考:Quickstart: Text-to-Speech
  • 安装google clould 的python库
  • 安装 Google Cloud Text-to-Speech API Python 依赖(Dependencies),参见github说明
  • ----其中包括了,安装pip install google-cloud-texttospeech==0.1.0

为了implicit调用,设置环境变量GOOGLE_APPLICATION_CREDENTIALS到你的API Key(json文件),完成后重启

python脚本:text到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 be 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特性

目前支持的6种voice type

参数说明

https://cloud.google.com/text-to-speech/docs/reference/rest/v1beta1/text/synthesize#audioconfig

  • input_text

  • voice

  • audio_config

通过google cloud API 使用 WaveNet的更多相关文章

  1. 【Google Cloud技术咨询】「Contact Center AI」引领我们走向高度智能客服的时代

    前提背景 我们距离"不再智障"的智能客服还有多远?对于智能客服,用户一直都是"批评多于褒奖",究其原因是在于人们对于AI客服的期待很高,而AI客服在实际应用中的 ...

  2. 利用Google Speech API实现Speech To Text

    很久很久以前, 网上流传着一个免费的,识别率暴高的,稳定的 Speech To Text API, 那就是Google Speech API. 但是最近再使用的时候,总是返回500 Error. 后来 ...

  3. Getting Started(Google Cloud Storage Client Library)

    在运行下面的步骤之前,请确保: 1.你的项目已经激活了Google Cloud Storage和App Engine,包括已经创建了至少一个Cloud Storage bucket. 2.你已经下载了 ...

  4. Activating Google Cloud Storage

    先决条件 你需要下面的内容: 1.一个Google账户,比如来自Gmail.如果你没有,请在Google account signup site注册. 2.一个新的或已经存在的Google Devel ...

  5. Downloading the Google Cloud Storage Client Library

    Google Cloud Storage client是一个客户端库,与任何一个生产环境使用的App Engine版本都相互独立.如果你想使用App Engine Development server ...

  6. Java Client for Google Cloud Storage

    关于Google Cloud Storage Google Cloud Storage有益于大文件的存储与服务(serve).此外,Cloud Storage提供了对访问控制列表(ACLs)的使用,提 ...

  7. 使用GCM服务(Google Cloud Messaging)实现Android消息推送

    最近在网上查了关于很多Android消息推送的资料,其中主要有四种方法. 1) 使用GCM服务(Google Cloud Messaging) 2) 使用XMPP协议(Openfire + Spark ...

  8. Asp.net MVC集成Google Calendar API(附Demo源码)

    Asp.net MVC集成Google Calendar API(附Demo源码) Google Calendar是非常方便的日程管理应用,很多人都非常熟悉.Google的应用在国内不稳定,但是在国外 ...

  9. 使用Google Cloud Platform构建机器学习项目-宠物识别

    宠物识别我们使用到了tensorflow object-detection API  (https://github.com/tensorflow/models/tree/master/researc ...

随机推荐

  1. Android连接服务器端的Socket

    package com.example.esp8266; import java.io.IOException;import java.io.InputStream;import java.io.Ou ...

  2. POJ - 1830:开关问题 (开关问题-高斯消元-自由元)

    pro:有N个相同的开关,每个开关都与某些开关有着联系,每当你打开或者关闭某个开关的时候,其他的与此开关相关联的开关也会相应地发生变化,即这些相联系的开关的状态如果原来为开就变为关,如果为关就变为开. ...

  3. Codeforces1099D.Sum in the tree(贪心)

    题目链接:传送门 思路: 一个节点放的数越大,那么以它为根的子树的节点权值之和就越小. 所以我们要在合法的范围内,使偶数层节点的权值尽可能地大.也就是说,令它的权值是子节点的最小值,这样保证了它的子节 ...

  4. JAVA第十次作业

    JAVA第十次作业 (一)学习总结 1.用思维导图对java多线程的学习内容进行总结. 参考资料: XMind. 2.下面是一个单线程实现的龟兔赛跑游戏. public class TortoiseH ...

  5. poj 1039

    #include <iostream> #include <algorithm> #include <cstring> #include <cstdlib&g ...

  6. python实现linux下文件遍历

    import os def getAllFile(*names): if len(names) == 0: return "" else: allList = [] for nam ...

  7. python入门——热量转换 I

    热量转换 I 描述 卡路里,简称卡(Calorie),缩写为cal,定义为在1个大气压下,将1克水提升1摄氏度所需要的热量,卡是能量单位,被广泛使用在营养计量方面.国际能量标准单位是焦耳(joule) ...

  8. WinForm关于更新程序的设计思路

    开发WINDOWS应用程序一般都会有一个自动更新的功能,这就需要提供一个单独的更新程序来更新主程序,那么主程序怎么检测是否有更新,以及更新程序怎么去更新主程序呢?下面将分开研究分析. 用VS发布向导发 ...

  9. php使用insert语句动态添加用户

    <html> <head> <title>Adding User</title> </head> <body> <h2&g ...

  10. ROS tf

    一.节点中使用(cpp,python) 1. ros wiki 提供的tutorials 2. https://blog.csdn.net/start_from_scratch/article/det ...