Попробуйте это;
public void recordAndSaveAudioFile(String audioName) {
saved_path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + "Special Folder";
File destinationDirectory = new File(saved_path);
if (!destinationDirectory.exists()) {
destinationDirectory.mkdirs();
}
destinationFile = new File(destinationDirectory, audioName);
try {
FileOutputStream outputStream = new FileOutputStream(destinationFile);
outputStream.flush();
outputStream.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
setupMediaRecorder(destinationFile);
try {
mediaRecorder.prepare();
mediaRecorder.start();
} catch (IOException e) {
e.printStackTrace();
}
Toast.makeText(this, "Recording...", Toast.LENGTH_SHORT).show();
}
private void setupMediaRecorder(File destination) {
mediaRecorder = new MediaRecorder();
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mediaRecorder.setAudioEncoder(MediaRecorder.OutputFormat.AMR_NB);
mediaRecorder.setOutputFile(Uri.parse(String.valueOf(destination)).toString());
}