通过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 ...
随机推荐
- oracle中left join,right join,inner join的坑
本文主要是记录一下实际使用oracle中join查询遇到的坑 1.用到两张表,学生表和学年分数表,先建立 2.普通连接查询 INNER JOIN,查询每个学年有成绩的学生以及分数情况 LFET JOI ...
- 关于OSI
OSI模型,即开放式通信系统互联参考模型(Open System Interconnection,OSI/RM,Open Systems Interconnection Reference Model ...
- 在LINUX(Ubuntu 18.04.x、CentOS)下配置MySQL8.0.x
安装教程:Installing MySQL on Unix/Linux Using Generic Binaries MySQL下载链接:https://dev.mysql.com/downloads ...
- Jquery图集
- C语言-第2次作业得分
作业链接:https://edu.cnblogs.com/campus/hljkj/CS20180的2/homework/2292 作业链接:https://edu.cnblogs.com/campu ...
- html中头meta信息
一.页面关键字 网站关键字:用户通过搜索引擎能搜到该网站的词汇.最好控制在10个以内. 基本语法: <meta name="keywords" content="具 ...
- Far manager界面混乱问题解决
刚装完,win7和XP上运行,都是界面混乱,看到网上说是属性里改字体,改编码,我试了半天不行: 最后发现,需要far.exe创建快捷方式,在快捷方式的属性里设置字体,编码,窗口大小,废话不多说,上图: ...
- XSS学习(一)
XSS(一) XSS分类 1.反射型XSS 2.持久性XSS 3.DOM型XSS **** 反射型XSS 也称作非持久型,参数型跨站脚本 主要将Payload附加到URL地址参数中 例如: http: ...
- table动态增加删除
基于网上代码修改实现动态添加表数据行 <!DOCTYPE html> <html lang="cn"> <html> <head> ...
- Lunar Lander 月球冒险
发售年份 1979 平台 街机 开发商 雅达利(Atari) 类型 飞行模拟 https://www.youtube.com/watch?v=McAhSoAEbhM