Cách phát triển ứng dụng nhận dạng giọng nói như Talking Tom?
1. Yêu cầu của tôi là cách nhận dạng giọng nói mà không có bất kỳ sự kiện nào như nút, sự kiện chạm)
2. Tất cả mẫu ghi âm có chứa nút, nhưng yêu cầu của tôi là nhận dạng giọng nói khi người dùng nói chuyện vào thời gian ghi âm giọng nói đó và khi người dùng dừng giọng nói nó tự động thay đổi giọng nói trong một số giọng nói khác như Tom hoặc vẹt
3. tôi đã thực hiện thông qua nútCách phát triển ứng dụng nhận dạng giọng nói như nói tom
java My
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();
cho nút play
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");
}