通过google cloud API 使用 WaveNet
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的更多相关文章
- 【Google Cloud技术咨询】「Contact Center AI」引领我们走向高度智能客服的时代
前提背景 我们距离"不再智障"的智能客服还有多远?对于智能客服,用户一直都是"批评多于褒奖",究其原因是在于人们对于AI客服的期待很高,而AI客服在实际应用中的 ...
- 利用Google Speech API实现Speech To Text
很久很久以前, 网上流传着一个免费的,识别率暴高的,稳定的 Speech To Text API, 那就是Google Speech API. 但是最近再使用的时候,总是返回500 Error. 后来 ...
- Getting Started(Google Cloud Storage Client Library)
在运行下面的步骤之前,请确保: 1.你的项目已经激活了Google Cloud Storage和App Engine,包括已经创建了至少一个Cloud Storage bucket. 2.你已经下载了 ...
- Activating Google Cloud Storage
先决条件 你需要下面的内容: 1.一个Google账户,比如来自Gmail.如果你没有,请在Google account signup site注册. 2.一个新的或已经存在的Google Devel ...
- Downloading the Google Cloud Storage Client Library
Google Cloud Storage client是一个客户端库,与任何一个生产环境使用的App Engine版本都相互独立.如果你想使用App Engine Development server ...
- Java Client for Google Cloud Storage
关于Google Cloud Storage Google Cloud Storage有益于大文件的存储与服务(serve).此外,Cloud Storage提供了对访问控制列表(ACLs)的使用,提 ...
- 使用GCM服务(Google Cloud Messaging)实现Android消息推送
最近在网上查了关于很多Android消息推送的资料,其中主要有四种方法. 1) 使用GCM服务(Google Cloud Messaging) 2) 使用XMPP协议(Openfire + Spark ...
- Asp.net MVC集成Google Calendar API(附Demo源码)
Asp.net MVC集成Google Calendar API(附Demo源码) Google Calendar是非常方便的日程管理应用,很多人都非常熟悉.Google的应用在国内不稳定,但是在国外 ...
- 使用Google Cloud Platform构建机器学习项目-宠物识别
宠物识别我们使用到了tensorflow object-detection API (https://github.com/tensorflow/models/tree/master/researc ...
随机推荐
- ss with kcptun
install ss apt search shadowsocks shadowsocks/kali-rolling,kali-rolling,now 2.9.0-2 all [installed] ...
- java将字符串存入oracle的Blob中
Blob内存放的是字节数组,需使用String的getBytes获得该字符串的字节数组(注意字符集编码),然后存入Blob. Oracle的Blob字段比较特殊,他比long字段的性能要好很多,可以用 ...
- 一起学python-语法
1.print 输出 2.定义变量:就是给变量赋一个值 name ='haha' print (name) 3.注释代码:# 注释快捷键:Ctrl +/ 4.单双引号: 如果字符串里面有单引号,外面就 ...
- flume实现kafka到hdfs测试用例
kafka 到hdfs at1.sources =st1 at1.channels = ct1 at1.sinks = kt1 # For each one of the sources, the t ...
- Windows 上安装 Azure PowerShell及Azure PowerShell部署虚拟机
一.Azure PowerShell部署 1.使用 PowerShellGet 在 Windows 上安装 Azure PowerShell 从 Azure PowerShell 版本 6.0 开 ...
- 软件开发者路线图梗概&书摘chapter5
恒久学习:整个职业生涯,反馈回路,了解弱点 1.提高带宽:多维度.高效获取知识 博客.关注twitter动态.订阅邮件列表.加入本地用户组.技术大会.联系书的作者.在线教程 从信息的海洋中回到实际软件 ...
- 12. Application-specific scanners (特定应用程序扫描器)
ike-scan是使用IKE协议发现.指纹和测试IPsec VPN服务器的命令行工具. 它通过向网络中的每个主机发送特制的IKE数据包来扫描VPN服务器的IP地址. 运行IKE的大多数主机都会响应,识 ...
- 真tm郁闷
昨天这时还是信心满满,今天这时就已经彻底颓了. 感觉这次是最接近的了,4个题目都做出来了,怎么还会fail,那边也不说为什么,到底是哪里不足,尽说些没用的. 前后都当了4次炮灰了,以后也不会再冲动了, ...
- CS萌新的汇编学习之路02 Learning of Assembly Language
第二节课 寄存器 1. 寄存器的定义: 进行信息储存的器件,是CPU中程序员可以读写的部件,通过改变各种寄存器中的内容来实现对CPU的控制 2. 寄存器的种类: 本节课学习通用寄存器和段寄存器 2. ...
- Java_03选择结构
1.if 选择结构 格式: if(判断条件){ // 语句块 }else if(判断条件){ // 语句块 2 }else{ // 语句块 3 } 当 if 关键字后的一对大括号里只有一个语句时,可以 ...