0

What additional settings are required for recording audio codec VORBIS?

MediaRecorder  recorder = new MediaRecorder();
recorder.setAudioSource(MIC);
recorder.setAudioEncodingBitRate(96000);
recorder.setAudioSamplingRate(44100);
recorder.setVideoSource(SURFACE);
recorder.setOutputFormat(MediaRecorder.OutputFormat.WEBM);
recorder.setVideoFrameRate(30);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.VP8);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.VORBIS);
recorder.setVideoSize(displayWidth , displayHeight );
recorder.setVideoEncodingBitRate(8 * 1000 * 1000);

Now preserved only vidio.

m0rych0k
  • 1
  • 1
  • 2

2 Answers2

0

Your Setting seem to be appropriate. However, I would recommend you to go to this link. and check once again.

[NOTE] : The WEBM format and VP8 videocodec require API LEVEL 21. I hope you are working on some lollipop device. Also, I tried It and didn't get successful. I hope you were successful in your attempt.

Chetan
  • 56
  • 6
0

i think you didnt set your audio source correct.
try this:

 mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
 ..
 ..
 ..
 mRecorder.setOutputFile(mFileNamePath);
Daniel Givoni
  • 350
  • 3
  • 10