See Also: MediaRecorder
public class MediaRecorder : Object
Used to record audio and video. The recording control is based on a simple state machine (see below).
A common case of using MediaRecorder to record audio works as follows:
MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); recorder.setOutputFile(PATH_NAME); recorder.prepare(); recorder.start(); // Recording is now started ... recorder.stop(); recorder.reset(); // You can reuse the object by going back to setAudioSource() step recorder.release(); // Now the object cannot be reused
Applications may want to register for informational and error events in order to be informed of some internal update and possible runtime errors during recording. Registration for such events is done by setting the appropriate listeners (via calls (to MediaRecorder.SetOnInfoListener(.IOnInfoListener)setOnInfoListener and/or MediaRecorder.SetOnErrorListener(.IOnErrorListener)setOnErrorListener). In order to receive the respective callback associated with these listeners, applications are required to create MediaRecorder objects on threads with a Looper running (the main UI thread by default already has a Looper running).
Note: Currently, MediaRecorder does not work on the emulator.
For more information about how to use MediaRecorder for recording video, read the Camera developer guide. For more information about how to use MediaRecorder for recording sound, read the Audio Capture developer guide.
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1
The members of Android.Media.MediaRecorder are listed below.
See Also: Object
Prepares the recorder to begin capturing and encoding data.
Releases resources associated with this MediaRecorder object.
Restarts the MediaRecorder to its idle state.
Sets the number of audio channels for recording.
Sets the audio encoder to be used for recording.
Sets the audio encoding bit rate for recording.
Sets the audio sampling rate for recording.
Sets the audio source to be used for recording.
Sets a Camera to use for recording.
Set video frame capture rate.
Set and store the geodata (latitude and longitude) in the output file.
Sets the maximum duration (in ms) of the recording session.
Sets the maximum filesize (in bytes) of the recording session.
Register a callback to be invoked when an error occurs while recording.
Register a callback to be invoked when an informational event occurs while recording.
Sets the orientation hint for output video playback.
Pass in the file descriptor of the file to be written.
Sets the path of the output file to be produced.
Sets the format of the output file produced during recording.
Sets a Surface to show a preview of recorded media (video).
Uses the settings from a CamcorderProfile object for recording.
Sets the video encoder to be used for recording.
Sets the video encoding bit rate for recording.
Sets the frame rate of the video to be captured.
Sets the width and height of the video to be captured.
Sets the video source to be used for recording.
Begins capturing and encoding data to the file specified with setOutputFile().