网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

语音识别android,语音识别转文字在线

Android中如何添加语音识别功能?详细步骤和代码?

android.speech.RecognizerIntent这个包里。前提是你的手机支持此功能。

10年积累的成都网站设计、成都做网站经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站设计制作后付款的网站建设流程,更有榕江免费网站建设让你可以放心的选择与我们合作。

开启操作:

Intent

intent

=

newIntent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);//开启语音识别功能。

intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,

RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);

//设置语言类型。

intent.putExtra(RecognizerIntent.EXTRA_PROMPT,

"请说话,我识别");

startActivityForResult(intent,REQUEST_CODE);

在onActivityResult()里用:

data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS)取得google云端反馈的数据即可。

如何在android平台上实现语音识别

语音识别,借助于云端技术可以识别用户的语音输入,包括语音控制等技术,下面我们将利用Google 提供的Api 实现这一功能。

功能点为:通过用户语音将用户输入的语音识别出来,并打印在列表上。

功能界面如下:

步骤阅读

2

用户通过点击speak按钮显示界面:

步骤阅读

3

用户说完话后,将提交到云端搜索

步骤阅读

4

在云端搜索完成后,返回打印数据:

步骤阅读

5

* Copyright (C) 2008 The Android Open Source Project

*

* Licensed under the Apache License, Version 2.0 (the "License");

* you may not use this file except in compliance with the License.

* You may obtain a copy of the License at

*

*

*

* Unless required by applicable law or agreed to in writing, software

* distributed under the License is distributed on an "AS IS" BASIS,

* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

* See the License for the specific language governing permissions and

* limitations under the License.

*/

package com.example.android.apis.app;

import com.example.android.apis.R;

import android.app.Activity;

import android.content.Intent;

import android.content.pm.PackageManager;

import android.content.pm.ResolveInfo;

import android.os.Bundle;

import android.speech.RecognizerIntent;

import android.view.View;

import android.view.View.OnClickListener;

import android.widget.ArrayAdapter;

import android.widget.Button;

import android.widget.ListView;

import java.util.ArrayList;

import java.util.List;

/**

* Sample code that invokes the speech recognition intent API.

*/

public class VoiceRecognition extends Activity implements OnClickListener {

private static final int VOICE_RECOGNITION_REQUEST_CODE = 1234;

private ListView mList;

/**

* Called with the activity is first created.

*/

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

// Inflate our UI from its XML layout description.

setContentView(R.layout.voice_recognition);

// Get display items for later interaction

Button speakButton = (Button) findViewById(R.id.btn_speak);

mList = (ListView) findViewById(R.id.list);

// Check to see if a recognition activity is present

PackageManager pm = getPackageManager();

List activities = pm.queryIntentActivities(

new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);

if (activities.size() != 0) {

speakButton.setOnClickListener(this);

} else {

speakButton.setEnabled(false);

speakButton.setText("Recognizer not present");

}

}

/**

* Handle the click on the start recognition button.

*/

public void onClick(View v) {

if (v.getId() == R.id.btn_speak) {

startVoiceRecognitionActivity();

}

}

/**

* Fire an intent to start the speech recognition activity.

*/

private void startVoiceRecognitionActivity() {

Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);

intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,

RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);

intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speech recognition demo");

startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);

}

/**

* Handle the results from the recognition activity.

*/

@Override

protected void onActivityResult(int requestCode, int resultCode, Intent data) {

if (requestCode == VOICE_RECOGNITION_REQUEST_CODE resultCode == RESULT_OK) {

// Fill the list view with the strings the recognizer thought it could have heard

ArrayList matches = data.getStringArrayListExtra(

RecognizerIntent.EXTRA_RESULTS);

mList.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1,

matches));

}

super.onActivityResult(requestCode, resultCode, data);

}

android模拟器如何使用语音识别

程序读取一个事先的录音文件,然后将其数据导入语音识别程序中进行识别,识别结果可通过控件显示出来

Android 上的语音识别是怎么实现

如果你想自己写引擎,我不太清楚,我只知道TTS引擎可以自己写,Voice Recognize就不知道了,不过利用Android提供的API就很容易了,API demo有示例,很简单。但如果用原生ROM可以直接开发,要是用第三方ROM就可能开发不了,需要先安装语音搜索,也就是语音识别的引擎,因为很多ROM制造团队删除了语音识别引擎

android 百度怎么使用语音识别转化成文字

使用百度Android将语音识别转化成文字,这样会方便整理一些信息,但是如何进行识别转换的操作呢?详细方法如下:

第一、将语音转化成文字,需要采用ocr文字识别技术的。

第二、来到语音识别版块后就可以点击添加文件按钮将保存好的录音文件添加进来了。

第三、点击右边开始识别区域就可以进行录音识别转换成文字的操作了。

对上面的方法有疑问的欢迎提问哦!希望这个方法可以帮助到您!

android如何自定义语音识别

google的语音识别返回的是一个String list,你和你预设的单词对比一下吧.


新闻标题:语音识别android,语音识别转文字在线
文章出自:http://bjjierui.cn/article/dsdjjci.html

其他资讯