百度ai语音转文字的开发流程

2021年11月17日

这个文章只是做为一个简单的介绍,重点还是要仔细查阅百度ai官网上的介绍。

百度ai开放平台:https://ai.baidu.com/tech/speech/asr

1. 创建应用
2、申请密钥
3、生成签名
4、启动开发

生成签名的时候,您需要使用创建应用所分配到的AppID、API Key及Secret Key,进行Access Token(用户身份验证和授权的凭证)的生成,方法详见 Access Token获取,我们为您准备了几种常见语言的请求示例代码。

请求URL数据格式

向授权服务地址https://aip.baidubce.com/oauth/2.0/token发送请求(推荐使用POST),并在URL中带上以下参数:

grant_type: 必须参数,固定为client_credentials;
client_id: 必须参数,应用的API Key;
client_secret: 必须参数,应用的Secret Key;

例如:https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=Va5yQRHlA4Fq5eR3LT0vuXV4&client_secret=0rDSjzQ20XUj5itV6WRtznPQSzr5pVw2&

#!/bin/bash
curl -i -k 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=【百度云应用的AK】&client_secret=【百度云应用的SK】'

#bash调用方法

服务器返回的JSON文本参数如下:

  • access_token: 要获取的Access Token;

  • expires_in: Access Token的有效期(秒为单位,有效期30天);

  • 其他参数忽略,暂时不用;

 

{
  "refresh_token": "25.b55fe1d287227ca97aab219bb249b8ab.315360000.1798284651.282335-8574074",
  "expires_in": 2592000,
  "scope": "public wise_adapt",
  "session_key": "9mzdDZXu3dENdFZQurfg0Vz8slgSgvvOAUebNFzyzcpQ5EnbxbF+hfG9DQkpUVQdh4p6HbQcAiz5RmuBAja1JJGgIdJI",
  "access_token": "24.6c5e1ff107f0e8bcef8c46d3424a0e78.2592000.1485516651.282335-8574074",
  "session_secret": "dfac94a3489fe9fca7c3221cbf7525ff"
}

 

音频转写:https://ai.baidu.com/ai-doc/SPEECH/7k38lxpwf


sicnature ---------------------------------------------------------------------
Your current IP address is: 34.230.66.177
Your IP address location: 美国弗吉尼亚阿什本
Your IP address country and region: 美国 美国
Your current browser is:
Your current system is:
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source https://www.myzhenai.com.cn/post/4008.html

没有评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注