Important Methods of MediaRecorder Class
Method |
Description |
---|---|
setAudioSource() | This method will specify the source of the audio to be recorded. |
setAudioEncoder() | This method is used to specify the audio encoder. |
setOutputFormat() | This method is used to specify the output format of our audio. |
setOutputFile() | This method is used to specify the path of recorded audio files that are to be stored. |
stop() | This method is used to stop the recording process. |
start() | This method is used to start the recording process. |
release() | This method is used to release the resource that is associated with the Media recorder class. |
Audio Recorder in Android with Example
In Android for recording audio or video, there is a built-in class called MediaRecorder. This class in Android helps to easily record video and audio files. The Android multimedia framework provides built-in support for capturing and encoding common audio and video formats. In android for recording audio, we will use a device microphone along with MediaRecorder Class and for recording video, we will use the user’s device Camera and MediaRecorder Class. Now in this article, we will see the implementation of an audio recorder in Android with an example.