I am trying to record audio with the following code.
public void onClick(DialogInterface dialog, int id) {
System.out.println("Inside Audio recording");
File storageDir = new File(Environment.getExternalStorageDirectory()+ "/filetoupload/");
if (!storageDir.exists()) {
storageDir.mkdirs();
}
try {
System.out.println("Inside Audio recording try block");
imageToStore = new File(storageDir,"" + "audio.3gp");
Intent intent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
intent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(imageToStore));
System.out.println("Inside Audio recording path"+ imageToStore);
startActivityForResult(intent,CAPTURE_AUDIO);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
It will open default android recording player and let me record audio file.
So basically it will start default audio recording and should create folder name filetoupload inside SD-card and should store it is as a name audio.3gp but it is not doing same. It is storing recording inside default recording folder in device or with some other name like recording-10555454545.3gp
So how can i store this audio inside SD-card particular folder and with audio.3gp name please help.