问题描述
我正在寻找有关使AudioRecord同时使用顶部和底部安装的麦克风的明确答案,因此我没有2个相同的(单声道)通道.我想知道在事前我可以做些什么以确保小工具能够提供良好的信息流.
I'm looking for a definitive answer on getting audioRecord to use both the top mounted and bottom mounted microphones so I don't have 2 identical (mono) channels. I'd like to know what polling I could do before hand to ensure that a gadget will provide a good stream.
我正在研究银河系联系5,但无法使其正常工作,因此我无法使它在所有设备上均保持稳定.
I'm working on a galaxy nexus 5, and can't get that to work so I'm no way near getting it stable across all the devices.
我已经尝试了所有MediaRecorder.AudioSource
.
AudioRecord audioInputStream1 = new AudioRecord(Media.Recorder.CAMCORDER,
sampleRate, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT,
samplesPerBuffer * bytesPerSample)
并实例化两个记录:
AudioRecord audioInputStream1 = new AudioRecord(Media.Recorder.MIC,
sampleRate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT,
samplesPerBuffer * bytesPerSample)
AudioRecord audioInputStream2 = new AudioRecord(Media.Recorder.CAMCORDER,
sampleRate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT,
samplesPerBuffer * bytesPerSample)
如果有人确实在连结5上获得了立体声录音,我将非常感谢您的帮助.我应该搬到alsa还是tinyAlsa?
If anyone did get stereo recording on a nexus 5 I'd greatly appreciate the help. Should I move to alsa or tinyAlsa?
谢谢,j
推荐答案
您的问题与我的问题和似乎答案取决于设备:
Your question is closely related to my question and it seems the answer is device-dependent:
1)对于某些设备(例如 Samsung S2 Plus GT-I9105P , HTC One M7 , HTC One M8 , G3 LG-D855 , Nexus 5 ,...)根本无法通过内置的话筒头来激活真实的立体声录音.尽管在某些情况下,制造商的便携式摄录机应用程序可以产生真实的立体声,但您找不到其他能够做到这一点的应用程序.
1) For some devices (e.g. Samsung S2 Plus GT-I9105P, HTC One M7, HTC One M8, G3 LG-D855, Nexus 5, ...) there is simply no way to activate real stereo recordings via the built-in microphone capsules. Although in some cases the camcorder app of the manufacturer produces real stereo you won't find any other app which is able to do that.
2)对于某些其他设备,仅MediaRecorder.AudioSource
和e.g.的少数特定组合.采样率(或其他基本设置)可实现真实的立体声录制(例如 Motorola Moto G 需要MediaRecorder.AudioSource.CAMCORDER
和48kHz采样率).
2) For some other devices, only few specific combinations of MediaRecorder.AudioSource
and e.g. sample rate (or other basic settings) enable real stereo recording (e.g. Motorola Moto G needs MediaRecorder.AudioSource.CAMCORDER
and 48kHz sample rate).
3)在大多数带有两个麦克风胶囊的设备上,AudioFormat.CHANNEL_IN_STEREO
足以激活真实的立体声录音.
3) On most devices with two microphone capsules AudioFormat.CHANNEL_IN_STEREO
is sufficient to activate real stereo recording.
不幸的是,如果不生根设备,Alsa或tinyAlsa很可能无法解决问题.
Unfortunately, Alsa or tinyAlsa will most probably not solve the problem without rooting the device.
这篇关于在Android中使用AudioRecord录制立体声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!