Home > Android Dev > Recording with Android MediaRecorder API

Recording with Android MediaRecorder API

MediaRecorder API, records in 3 file formats

1. 3gpp

2.AMR

3. Mp4

All there formats uses AMR encoder, code snippet given below recods for any audio source(as) such as:

MediaRecorder.AudioSource.DEFAULT,  MediaRecorder.AudioSource.VOICE_DOWNLINK,

MediaRecorder.AudioSource.VOICE_UPLINK, MediaRecorder.AudioSource.VOICE_CALL

mr = new MediaRecorder();
mr.setAudioSource(as); // as  = Audio Source
mr.setOutputFormat(ff); // ff = FileFormat
mr.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mr.setOutputFile(RECORDING_FILE); // filepath of the recording file
mr.prepare();
mr.start();

Note that, this API is compatible only with Android DONUT, does’nt work with Eclair and Froyo.

Tested and Verfied on LG GT 540 and guess to work with all devices based on this processor.

Microprocessor,Chipset LG GT540 SWIFT (Optimus)

CPU:Clock: 600 MHz
CPU: Qualcomm MSM7227
Browse devices based on this microprocessor
Advertisements
Categories: Android Dev
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: