1

Currently I am developing an app which records video of mobile screens (screen recording) as per user interactions. Now I want to record video with audio or sound. How can I achieve this feature?

for video recording I am using following code:

    mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.SURFACE);
    mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
    mMediaRecorder.setOutputFile(videofilePath);
    mMediaRecorder.setVideoSize(DISPLAY_WIDTH, DISPLAY_HEIGHT);
    mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
    mMediaRecorder.setVideoEncodingBitRate(3000000);
    mMediaRecorder.setVideoFrameRate(24);
    mMediaRecorder.prepare();
    mMediaRecorder.start();
Nik
  • 1,991
  • 2
  • 13
  • 30

1 Answers1

1

Insert This code

mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
Vishal Bhut
  • 102
  • 1
  • 11