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. jQuery-4.动画篇---动画基础隐藏和显示

    jQuery中隐藏元素的hide方法 让页面上的元素不可见,一般可以通过设置css的display为none属性.但是通过css直接修改是静态的布局,如果在代码执行的时候,一般是通过js控制元素的st ...

  2. oracle中left join,right join,inner join的坑

    本文主要是记录一下实际使用oracle中join查询遇到的坑 1.用到两张表,学生表和学年分数表,先建立 2.普通连接查询 INNER JOIN,查询每个学年有成绩的学生以及分数情况 LFET JOI ...

  3. Linux 添加DNS配置

    Centos7.5 系统,保存退出后自动生效 vi /etc/resolv.conf #阿里云DNS nameserver 223.5.5.5nameserver 223.6.6.6 #百度DNSna ...

  4. Python全栈之路----常用模块----软件开发目录规范

    目录基本内容 log  #日志目录 conf  #配置目录 core/luffycity  #程序核心代码目录  #luffycity 是项目名,建议用小写 libs/modules  #内置模块 d ...

  5. MySQL 规范

    一.数据库命令规范 二.数据库基本设计规范 三.数据库字段设计规范 四.索引设计规范 五.常见索引列建议 六.如何选择索引列的顺序 七.避免建立冗余索引和重复索引 八.优先考虑覆盖索引 九.索引SET ...

  6. Java基于opencv—归一化

    Opencv中提供了resize函数,可以把图像调整到相同大小 Java中resize函数的声明,内部调用的都是native方法 public static void resize(Mat src, ...

  7. 如何注册Tomcat到Window Service服务

    win+R打开运行窗口,输入cmd打开dos窗口,使用cd命令将位置切换到tomcat路径下的bin文件,本机是F盘下. 先输入F:回车进入F盘,然后输入命令cd F:\apache-tomcat-5 ...

  8. JVM垃圾收集器-Serial Old收集器,Parallel Old收集器

    Serial Old收集器 Serial Old收集器是Serial收集器的老年代版本,它是一个单线程收集器,使用“标记-整理”算法.这个收集器的主要意义也是被Client模式下的虚拟机使用.在ser ...

  9. FragmentXlistview

    package com.example.lenovo.tablayout; /** * Created by lenovo on 2018/7/18. */ import android.os.Asy ...

  10. ODS ,EDW,DM

    ODS: 操作数据存储ODS(Operational Data Store),操作型数据仓库,最早的数据仓库模型,是数据仓库体系结构中的一个可选部分,ODS具备数据仓库的部分特征和OLTP系统的部分特 ...