题记:娱乐性的玩玩百度接口。

说实话,其接口个人觉得有点烂,重试了好几个音频文件才成功。

1、重新申请AppID、SecretKey 、API Key。

链接:https://console.bce.baidu.com/ai/?fromai=1#/ai/speech/overview/index

2、百度的案例代码

   /**
* 语音识别
*/
public static void voiceRecongnize(){
AipSpeech client = new AipSpeech(BaiduConfig.VOICE_APP_ID, BaiduConfig.VOICE_API_KEY, BaiduConfig.VOICE_SECRET_KEY);//这个要自己写哦
String path = "C:\\Users\\yangwj\\Desktop\\temp.wav";
try{
JSONObject asrRes = client.asr(path, "wav", 16000, null);
System.out.println(asrRes); // 对语音二进制数据进行识别
byte[] data = Util.readFileByBytes(path); //readFileByBytes仅为获取二进制数据示例
JSONObject asrRes2 = client.asr(data, "pcm", 16000, null);
System.out.println(asrRes2);
}catch (Exception e){
e.printStackTrace();
}
}

这样就可以调用运行了。

最新文章

  1. 非RootLayer的隐式动画
  2. 搞不清FastCgi与PHP-fpm之间是个什么样的关系?
  3. Android基础学习第一篇—Project目录结构
  4. Java this的一两点使用
  5. [原创]Mac系统下制作OS 10.11安装镜像
  6. Linux内核中断学习
  7. editplus如何配置php编译环境?
  8. 浏览器JS脚本
  9. [转载]Spring Autowire自动装配介绍
  10. SQL Server select into/bulkcopy用法
  11. cplusplus解析
  12. 【转】shell 教程——04 什么时候使用Shell
  13. Dalvik虚拟机的优化机制
  14. not accessible due to restriction on required library
  15. Elasticsearch .net 客户端条件拼接查询
  16. CSS居中的几种方式总结
  17. Android 架构 -- Room
  18. 使用Hexo+Github搭建属于自己的博客(基础)
  19. Page11:状态反馈、输出反馈的概念及性能比较,极点配置的基本概念、意义及其算法[Linear System Theory]
  20. 好用的图片缩放JS

热门文章

  1. Visual Studio 2019社区版:错误 MSB6006 “CL.exe”已退出,代码为 2
  2. 2019ICPC南京网络赛A题 The beautiful values of the palace(三维偏序)
  3. java中activiti框架中的排他网关使用方法,多条件判断
  4. .NET Core 3时代!如何使用DevExpress WPF创建应用
  5. 决策树--CART树详解
  6. 【51nod 2004】终结之时
  7. oracle rowtype
  8. 什么是URL百分号编码?
  9. 安装java1.8.0
  10. UCenter网站部署