Cannot change number of audio channels field for mediarecorder

144 Views Asked by At

For an application, I'm setting up the MediaRecorder using the following:

mediaRecorder.setAudioSource(AudioSource.MIC);
mediaRecorder.setVideoSource(VideoSource.SURFACE);
CamcorderProfile cpHigh = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH);
cpHigh.audioChannels = 2; 
mediaRecorder.setProfile(cpHigh);
mediaRecorder.setVideoSize(specifiedWidth, specifiedHeight);
mediaRecorder.setOutputFile(videoFilename);
try {
  mediaRecorder.prepare();
} catch (Exception e) {
  ...
}

Despite setting cpHigh.audioChannels = 2; the saved files have mono audio. If I change the code to have mediaRecorder.setAudioChannels(2); instead, it still doesn't work; I'm still seeing Mono, instead of Stereo. Any idea why?

0

There are 0 best solutions below