首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何开发类似talking tom的语音识别应用

如何开发类似talking tom的语音识别应用
EN

Stack Overflow用户
提问于 2012-07-06 15:38:37
回答 1查看 8.2K关注 0票数 14

如何开发语音识别应用程序,像Talking?

代码语言:javascript
复制
 1. My request is how to recognize the voice without any events like buttons, touch events)
  1. All语音记录示例包含通过按钮,但我的要求是在用户说话时识别语音录制语音,当用户停止语音时,它会自动修改其他语音中的语音,如Tom或parrot
  2. 我已经通过button

完成了

我的.java

代码语言:javascript
复制
File storageDir = new File(Environment.getExternalStorageDirectory(), "SRAVANTHI");
storageDir.mkdir();
Log.d(APP_TAG, "Storage directory set to " + storageDir);
outfile = File.createTempFile("hascode", ".3gp", storageDir);

// init recorder
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(outfile.getAbsolutePath());

// init player
player.setDataSource(outfile.getAbsolutePath());

try {
    recorder.prepare();
    recorder.start();
    recording = true;
} catch (IllegalStateException e) {
    Log.w(APP_TAG, "Invalid recorder state .. reset/release should have been called");
} catch (IOException e) {
    Log.w(APP_TAG, "Could not write to sd card");
}

recorder.stop();

用于播放按钮

代码语言:javascript
复制
try {
    playing = true;
    player.prepare();
    player.start();
} catch (IllegalStateException e) {
    Log.w(APP_TAG, "illegal state .. player should be reset");
} catch (IOException e) {
    Log.w(APP_TAG, "Could not write to sd card");
}
EN

回答 1

Stack Overflow用户

发布于 2014-02-20 21:34:22

先检查音量,当音量超过一定值后再录音,怎么样?

也许这将是有用的:android: Detect sound level

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11357862

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档