Android - Audio Capture Tutorial
Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but the most common way is through MediaRecorder class. Android provides MediaRecorder class to record audio or video. In order to use MediaRecorder class ,you will first create an instance of MediaRecorder class. Its syntax is given below. MediaRecorder myAudioRecorder = new MediaRecorder (); Now you will set the source , output and encoding format and output file. Their syntax is given below. myAudioRecorder . setAudioSource ( MediaRecorder . AudioSource . MIC ); myAudioRecorder . setOutputFormat ( MediaRecorder . OutputFormat . THREE_GPP ); myAudioRecorder . setAudioEncoder ( MediaRecorder . OutputFormat . AMR_NB ); myAudioRecorder . setOutputFile ( outputFile ); After specifying the audio source and format and its output file, we can then call the two basic methods prepare and start to start recording the audio. myAudioRecord...