惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
C
Check Point Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
F
Full Disclosure
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
K
Kaspersky official blog
博客园 - 司徒正美
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Cisco Talos Blog
Cisco Talos Blog
Know Your Adversary
Know Your Adversary
雷峰网
雷峰网
V
V2EX - 技术
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Spread Privacy
Spread Privacy
罗磊的独立博客
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
O
OpenAI News
Jina AI
Jina AI
PCI Perspectives
PCI Perspectives
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
I
InfoQ
D
Docker
P
Palo Alto Networks Blog
Recorded Future
Recorded Future
M
MIT News - Artificial intelligence
博客园 - Franky
B
Blog
Scott Helme
Scott Helme
博客园 - 叶小钗
D
DataBreaches.Net

博客园 - 滴水冰寒

阿里云linux--常用命令 electron桌面应用 wepack打包时出错不压缩代码及使用es7(async await)新语法问题 npm install 时发生错误 create-react-app 后使用babel/polyfill webpack3.x--react,jsx多页配置 webpack--打包scss webpack--打包和压缩css react--2.react-redux react--1.创建项目 vscode和gitee的使用 vue--1.环境搭建及创建项目 Python内置的服务器的使用 ionic3问题记录 ionic3自定义android原生插件 maven学习--1.项目结构及简单使用 maven学习--1.安装与配置 mybatis学习笔记1.零碎记录 mysql学习--1.事务
百度智能语音引用1
滴水冰寒 · 2018-11-22 · via 博客园 - 滴水冰寒

1.登录百度开发者账号,申请语音应用

https://console.bce.baidu.com/ai/

2.创建语音应用,创建后查看apikey,secretkey

应用名称

AppID

API Key

Secret Key

包名

语音播报提醒

14899961

***************

******* 显示

百度语音
 

3.换取 token

访问如下网址, 可用浏览器测试

// appKey = Va5yQRHl********LT0vuXV4
// appSecret = 0rDSjzQ20XUj5i********PQSzr5pVw2

https://openapi.baidu.com/oauth/2.0/token?grant_type=client_credentials&client_id=Va5yQRHl********LT0vuXV4&client_secret=0rDSjzQ20XUj5i********PQSzr5pVw2

可以获取如下结果

{
    "access_token": "1.a6b7dbd428f731035f771b8d********.86400.1292922000-2346678-124328",
    "expires_in": 2592000,
    "refresh_token": "2.385d55f8615fdfd9edb7c4b********.604800.1293440400-2346678-124328",
    "scope": "public audio_tts_post ...",
    "session_key": "ANXxSNjwQDugf8615Onqeik********CdlLxn",
    "session_secret": "248APxvxjCZ0VEC********aK4oZExMB",
}

scope中含有audio_tts_post 表示有语音合成能力,没有该audio_tts_post 的token调用接口会返回502错误。
在结果中可以看见 token = 1.a6b7dbd428f731035f771b8d**.86400.1292922000-2346678-124328,在2592000秒(30天)后过期。

4.下载官方demo,查看调用方法

https://github.com/Baidu-AIP/SPEECH-TTS-CORS

主要是引用里面的baidu_tts_cors.js文件以及跨域,注意在调用时,要把demo里的换成你自己的,然后即可测试了

audio = btts({
            tex: text,
            tok: '你自己的access_token',
            spd: 5,
            pit: 5,
            vol: 15,
            per: 4
        }

5.参考网址

https://console.bce.baidu.com/ai/?_=1542849502144#/ai/speech/app/detail~appId=648253

https://cloud.baidu.com/doc/SPEECH/TTS-API.html#.E6.8D.A2.E5.8F.96token

6.

应用名称

AppID

API Key

Secret Key

包名

语音播报提醒

14899961

tM50lZ3C3lNCTLxqQV3nFG1I

******* 显示

百度语音