【Android开发学习45】使用google语音识别引擎(Google Speech API)<一>
2013-05-23 18:54
846 查看
最近项目中需要研究语音识别功能,感觉挺好玩的,特别搜索了大量的资料来学习,这一篇是参考网上的一篇文章记录出来的,主要是以用户的角度来使用google语音识别引擎,与代码无关。
语音搜索网站,挺好用的,不过要装chrome!!!
网址是:http://slides.html5rocks.com/#speech-input
1、准备必要的软件: flac.exe , wget.exe 。(前面那个是转码用的,后面那个用于HTTP提交和接收数据,将两者放到D盘根目录测试)
2、首先安装一个W***录音的软件,也可以使用Windows自带的。先录音,并保存文件名为: test.wav 。
3、打开命令行,转入D盘,键入:
> flac.exe -8 -f --sample-rate=16000 test.wav
这是将test.wav文件转换成flac文件,转换完存放在当前目录下,存放的文件名为test.flac
接着键入:
> wget
-O "GoogleSpeechAPI.txt" --user-agent="Mozilla/5.0" --post-file=test.flac --header="Content-Type: audio/x-flac; rate=16000" "http://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=zh-CN&maxresults=1"
就会将test.flac的语音转换成文本文件,存放在GoogleSpeechAPI.txt里,打开可看到:
{
"status":0,
"id":"8f9d46231ac2dadee91d8d6ba1b57779-1",
"hypotheses":
[
{"utterance":"那不行哦","confidence":0.87555957}]
}
这个算是对使用google语音识别引擎的一个初体验吧,感觉挺好玩的,所以记录一下。
参考文章
: http://hi.baidu.com/stoneforestwhu/item/84857330d9ccb102b2c0c55f
本文博客源地址:http://blog.csdn.net/ypist
语音搜索网站,挺好用的,不过要装chrome!!!
网址是:http://slides.html5rocks.com/#speech-input
1、准备必要的软件: flac.exe , wget.exe 。(前面那个是转码用的,后面那个用于HTTP提交和接收数据,将两者放到D盘根目录测试)
2、首先安装一个W***录音的软件,也可以使用Windows自带的。先录音,并保存文件名为: test.wav 。
3、打开命令行,转入D盘,键入:
> flac.exe -8 -f --sample-rate=16000 test.wav
这是将test.wav文件转换成flac文件,转换完存放在当前目录下,存放的文件名为test.flac
接着键入:
> wget
-O "GoogleSpeechAPI.txt" --user-agent="Mozilla/5.0" --post-file=test.flac --header="Content-Type: audio/x-flac; rate=16000" "http://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=zh-CN&maxresults=1"
就会将test.flac的语音转换成文本文件,存放在GoogleSpeechAPI.txt里,打开可看到:
{
"status":0,
"id":"8f9d46231ac2dadee91d8d6ba1b57779-1",
"hypotheses":
[
{"utterance":"那不行哦","confidence":0.87555957}]
}
这个算是对使用google语音识别引擎的一个初体验吧,感觉挺好玩的,所以记录一下。
参考文章
: http://hi.baidu.com/stoneforestwhu/item/84857330d9ccb102b2c0c55f
本文博客源地址:http://blog.csdn.net/ypist
相关文章推荐
- 【Android开发学习45】使用google语音识别引擎(Google Speech API)<一>
- Android 新API 之 MediaCodec使用笔记 <一>
- Android学习之多线程开发总结<一>
- 使用Google语音识别引擎(Google Speech API)
- Android开发-API指南-<application>[原创译文]
- Android开发-API指南-<compatible-screens>
- Android开发-API指南-<instrumentation>
- min3d引擎使用指南(Android)<一>
- Android开发-API指南-<application>
- Android开发-API指南-<activity-alias>
- Android开发-API指南-<grant-uri-permission>
- Android开发-API指南-<provider>[原创译文]
- 【miscellaneous】使用Google语音识别引擎(Google Speech API)[3月5日修改]
- Android 学习意外第五季<2>——google GPS定位由经纬度转换地址信息
- Android开发收集<一>
- 3G之Android学习第二章节<<开发第一个HelloWorld应用程序>>
- Android开发-API指南-<path-permission>
- Android开发-API指南-<activity-alias>
- Android 数据库ORM框架GreenDao学习心得及使用总结<一>
- Android开发-API指南-<manifest>