0
사용하여 안드로이드에 소리를 내 코드에서 다음과 같습니다녹화 내가 AudioRecorder 클래스 를 사용하여 소리를 기록하는 안드로이드 응용 프로그램을 개발하고 있어요 MediaRecorder
public void start() throws IOException {
String state = android.os.Environment.getExternalStorageState();
if(!state.equals(android.os.Environment.MEDIA_MOUNTED)) {
throw new IOException("SD Card is not mounted. It is " + state + ".");
}
// make sure the directory we plan to store the recording in exists
File directory = new File(path).getParentFile();
if (!directory.exists() && !directory.mkdirs()) {
throw new IOException("Path to file could not be created.");
}
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
System.out.println("mashi");
recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setAudioEncodingBitRate(16);
recorder.setAudioSamplingRate(44100);
try {
recorder.setOutputFile(path);
System.out.println("ooutput");
} catch (IllegalStateException e) {
e.printStackTrace();
}
recorder.prepare();
recorder.start();
}
녹음 된 음성은 매우 느리고 두꺼운 !! !! 무엇이 문제입니까?