Recording stereo audio with a Motorola Moto G (or Moto X)

て烟熏妆下的殇ゞ 提交于 2019-11-30 23:52:22

I had the same problem, and I got it to work using a sample rate of 48000 Hz. I figured it would work since the video recordings made with the default camera app worked in stereo and had this sampling rate. This frequency must also be considered when using the function getMinBufferSize().

Here are my settings:

private static final int RECORDER_BPP = 16;
private static final int RECORDER_SAMPLERATE = 48000;
private static final int RECORDER_CHANNELS = AudioFormat.CHANNEL_IN_STEREO;
private static final int RECORDER_AUDIO_ENCODING = AudioFormat.ENCODING_PCM_16BIT;

and then I create the AudioRecord object with:

recorder = new AudioRecord(MediaRecorder.AudioSource.CAMCORDER,
                                            RECORDER_SAMPLERATE, RECORDER_CHANNELS,RECORDER_AUDIO_ENCODING, bufferSize);

I am using the Moto G, with KitKat installed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!