9
如何開發聲音識別像會說話的湯姆應用程序?
1.我的要求是如何識別聲音不象按鈕的任何事件,觸摸事件)
2.通過按鈕包含所有錄音樣本,但我的要求是認識的聲音在上一次使用的用戶通話記錄的聲音,當用戶停止的聲音,它會自動修改的聲音在其他一些聲音如湯姆或人云亦云
3.我已經通過按鈕如何開發聲音識別像會說話的tom
我的.java
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();
做了播放按鈕
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");
}