Media Recorder Output Formats

The next method to be called in sequence is setOutputFormat. The values this takes in are specified as constants in the MediaRecorder.OutputFormat inner class.

MediaRecorder.OutputFormat.MPEG_4: This specifies that the file written will be an MPEG-4 file. It may contain both audio and video tracks.

■ MediaRecorder.OutputFormat.RAW_AMR: This represents a raw file without any type of container. This should be used only when capturing audio without video and when the audio encoder is AMR_NB.

■ MediaRecorder.OutputFormat.THREE_GPP: This specifies that the file written will be a 3GPP file (extension .3gp). It may contain both audio and video tracks.

recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);

+1 0

Post a comment