Stereo AudioRecord gives two identical channels

I'm new to Android Studio and while trying to create my first app I need to record stereo audio. I'm using the AudioRecord class with the following statements:

 recorder = new AudioRecord(MediaRecorder.AudioSource.MIC, sampleRate,
                                    AudioFormat.CHANNEL_IN_STEREO,
                                    AudioFormat.ENCODING_PCM_16BIT,bufferSize);

      

Im using 2 external microphones connected to a sound card that connects to the phone via USB. Stereo recording works great when using the same audacious sound card on my computer.

But in the application, the problem occurs when using the Javas method recorder.read(sData, 0 , Elements2Rec)

: I get two identical feeds . sData

looks like [1,1,8,8,0,0,-9,-9, etc]

with the same patterns in every frame.

The only signal the app receives is actually the same as the signal that one of the microphones is recording, but I've not found a solution to receive the signal from the second microphone. The same question was asked a long time ago on this link or that link or thaat link , but I couldn't solve my problem with them.

Anyone can figure out what I can do please?


Here is some additional information if it might help: My application needs to save the audio in a pcm file so that im write bytes after byte using the output of the recorder.read () method.

My target API is 15 and I am testing the app on a Samsung Galaxy A3.

I've declared the audio resolution in the manifest, but nothing more than how to handle the microphones because I don't know if this is needed and how to do it. Im using WM-4000PTV2 microphones and a Behringer UCA222 sound card.

+3


source to share





All Articles