Google Voice 语音搜索
来源:互联网 发布:个人博客系统源码 编辑:程序博客网 时间:2024/04/28 18:06
在android应用中加入语音功能,将使应用更加的实用、方便。google的语音使用还是比较简单的,下面给大家介绍一下使用方法:
1、下载Google Voice的APK安装包,在手机中进行安装。
2、Android调用Google Voice代码
private static final int RESULT_FROM_VOICE = 1;
(1) 启动谷歌语音
/** * 启动谷歌语音 */private void startGoogleVoice() {try{Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "开始语音"); startActivityForResult(intent, RESULT_FROM_VOICE);}catch(ActivityNotFoundException e){// 下载谷歌语音APK包,并安装。FileDownload fd = new FileDownload(ExpressActivity.this, ConstData.googleVoiceUrl, "下载谷歌语音引擎");fd.showDownloadNoticeDialog();} }
(2)接收返回值
重写Activity的onActivityResult方法
//返回值@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {if(data == null)return;//谷歌语音if(requestCode == RESULT_FROM_VOICE){ matches = data.getStringArrayListExtra( RecognizerIntent.EXTRA_RESULTS); if(matches != null && matches.size() > 0){ Dialog dialog = new GoogleVoiceDialog(ExpressActivity.this, R.style.GoogleVoiceDialog); dialog.show(); }}super.onActivityResult(requestCode, resultCode, data);}
3、效果图
- Google Voice 语音搜索
- 【Google Voice】Android 轻松实现语音识别
- Android 语音识别+语音搜索源码 Voice Search
- Android 语音识别+语音搜索源码 Voice Search
- Android 语音识别+语音搜索源码 Voice Search
- Android 语音识别+语音搜索源码 Voice Search
- Android 语音识别+语音搜索源码 Voice Search
- google推出语音搜索
- google voice
- google的语音搜索工具
- Google Voice、Voice Search 安装
- Google Voice、Voice Search 安装
- Voice input 语音输入
- 避开Google Voice Search利用Google Speech API实现Android语音识别之原理
- 避开Google Voice Search利用Google Speech API实现Android语音识别之Demo实现
- Google开始测试语音搜索功能
- google语音搜索识别API【转载】
- 语音邮件 voice mail 概述
- 第二章 数据准备
- 关于JavaScript的 childNodes 方法的返回结果
- hdu 4547 CD操作(金山居 LCA算法)
- 硬盘杂记
- POJ 1005
- Google Voice 语音搜索
- VS2008编译驱动
- IOS开发中常用的单例模式宏定义
- 成环求连续m个最大序列
- hdu 4545 魔法串(金山居)
- oracle 11g 静默安装----准备篇
- php session超时设置
- 朋友圈,已知m对朋友,求新增朋友对数...
- ios 判断电话号码和电子邮件的规范