This is my Code . I could able to do direct access after i disconnect the
USB. I could able to access like recording , playing etc. But i couldnt
able to do second time. Whats wrong here ?
private void beginRecording() throws Exception {
//bMediaRecorder();
//try{
File outFile=new File(OUTPUT_FILE);
// }
if(outFile.exists())
outFile.delete();
if(recorder!=null)
recorder=null;
recorder=new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
recorder.setOutputFormat(MediaRecorder.OutputFormat.RAW_AMR);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
recorder.setOutputFile(OUTPUT_FILE);
recorder.prepare();
recorder.start();
}
private void bMediaRecorder() {
// TODO Auto-generated method stub
if(recorder!=null)
recorder.release();
}
On Tue, Jul 31, 2012 at 8:52 PM, bob <[email protected]> wrote:
> The problem is likely that your app is still dormant. It has not exited.
>
> What has happened is that it is paused, and when you go back to it,
> onResume is called… not onCreate.
>
> You can make your app truly exit when the back button is pressed by adding
> this to your Activity class.
>
> @Override
> public void onBackPressed() {
>
> System.exit(0);
> }
>
> Some people consider this bad, so I'm only recommending it as a diagnostic
> aid.
>
>
> On Tuesday, July 31, 2012 7:30:56 AM UTC-5, Meena Rengarajan wrote:
>>
>> Once USB is connected i could able to record the audio and playing well
>> in mobile. But once if i closed my application or disconnected USB then i
>> couldnt able to record the audio in direct access. So again if i opened and
>> recorder as a fresh one its not recording the audio ! Whats the problem
>> here ?
>>
>> On Tuesday, July 31, 2012 12:01:49 PM UTC+5:30, Meena Rengarajan wrote:
>>>
>>> I have created a file name "music_1.amr".. When i recording audio it
>>> will capture and stored in "music_1.amr" . So i can do play, stop or save..
>>> Now i wanna do is, whenever i create a new audio recording that previous
>>> recorded audio should be deleted automatically and this new audio capture
>>> must store it in same file name "music_1.amr". What do i wanna do here .
>>> Can anyone suggest me?
>>>
>> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en