2
オーディオファイルを.m4a形式で録音するにはどうすればいいですか?あなたの例では、出力形式を設定する場所オーディオファイルを.m4a形式で録音するにはどうすればよいですか?
public void startRecording() throws IOException {
recorder = new MediaRecorder();
path = "/sdcard/pithysongs_" + System.currentTimeMillis() + ".m4a";
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
+ ".");
}
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(path);
recorder.prepare();
recorder.start();
}
感謝..
ここ