나는 3gp 형식으로 오디오를 녹음하고 SD 카드에 보관했습니다. 이것은 내 코드이며 sucessfull을 실행합니다. 추가 된 이미지가 오디오 파일에 추가되도록 이미지에 오디오 파일을 추가해야합니다. 앨범 표지 내가 android..like이의 기본 미디어 플레이어에서 SD 카드 위치에서 가져온 녹음 된 오디오를 재생하려고 &는 ..안드로이드에서 오디오 녹음
가 그림에 표시된 이미지는 내가 가지고있는 앨범 커버입니다 녹음 된 오디오 파일에 내 보냅니다.
/**
* Starts a new recording.
*/
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);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
System.out.println("audio_file_path : = " + path);
recorder.setOutputFile(path);
recorder.prepare();
recorder.start(); // Recording is now started
}