My goal is to capture video using an Android camera and record Voice from a microphone.
I googled the code but could not get any working example or code.
what i tried
recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT); CamcorderProfile cpHigh = CamcorderProfile .get(CamcorderProfile.QUALITY_HIGH); recorder.setProfile(cpHigh); recorder.setOutputFile("/sdcard/videocapture_example.mp4"); recorder.setMaxDuration(50000);
I get a RuntimeException
java.lang.RuntimeException: setAudioSource failed.
in the next line
recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
tried with replacement
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
but it doesnβt work either.
source share