October 1st, 2012, 10:49 PM
|
#1 (permalink)
|
|
New Member
Thread Author (OP)
Join Date: Oct 2012
Posts: 4
Device(s):
Carrier: Not Provided
Thanks: 0
Thanked 0 Times in 0 Posts
|
How to create sdcard in emulater to save recorded file??
Hi all,
i am beginner in android development.i am trying to recording on button click.
mycode is following::
HTML Code:
HTML Code:
private void StartAudioRecording() {
File sampleDir=Environment.getExternalStorageDirectory();
try {
audioFile=File.createTempFile("sound","3gp",sampleDir);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(audioFile.getAbsolutePath());
try {
recorder.prepare();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
recorder.start();
}
when i was running application in debug mode application getting crash.pls tell me what is wrong in this code.....
i am not getting sdcard path .
pls help me how to solve my issue.
thanks in advance
Ambrish Singh
|
|
|