我已录制3gp格式的音频,并将其保存在SD卡中..这是我的代码,它运行sucessfull ..我需要添加图像到该音频文件,以便添加的图像将是专辑封面&当我尝试播放从SD卡位置的android..like这个默认媒体播放器所记录的声音..在Android中录制音频
图片中显示的图像是专辑封面,我有把它给我录制的音频文件
/**
* 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
}