Multichannel Audio recording in Android - android

I have a multichannel microphone connected to an android phone (pixel 3) through usb. I'm trying to use MediaRecorder API for recording audio. However, there doesn't seem to be a way to setup multichannel recording with MediaRecorder even though Android USB audio documentation seems to say it allows multichannel input. I know recording multi channel audio is possible, as there are apps that already do that (see ntrack). I'm trying to figure out how to do this and hoping it doesn't involve writing usb driver (like these developers).

If you can see your microphones as separate input devices using audioService.getDevices(AudioManager.GET_DEVICES_INPUTS) then you can use the AAudio API (preferably using Oboe library) to access each of these microphones by opening stream for each.

Related

Streaming audio between external bluetooth device and Android phone

I'm considering building an Android app that allows for streaming audio via bluetooth to and from the Android phone. I've read similar questions on Stackoverflow before, and based on my understanding, A2DP cannot be used as Android can't become an A2DP sink.
In theory, I believe that a profile such as HFP or HFP AG should allow for bidirectional audio streams. In the Android API, is there a way to force a bluetooth pairing to follow this profile, or does the OS decide which profile to use (such as forcing HFP only when there's a phone call going on)?
I've been able to achieve what I wanted using RFCOMM-based SPP. In order to send audio to the external device, I use the AudioRecord API to record PCM-16 audio to stream audio realtime over Bluetooth. In order to receive audio, I spawn a thread that is responsible for outputting audio to the speaker using the AudioTrack API (in streaming mode)

Stereo recording using 2 external mic?

I am new to android development. I am trying to record an audio file in stereo mode. I have connected two external mics using 3.5mm jack.
The only problem is that my recording is done in mono mode. Both speakers sounds same. I am using inbuilt recorder app in my phone. Is stereo recording possible in smartphones using external mic? If so, do I need to code for stereo recording? And what libraries should I use?
Speak two different words, one to each microphone and try to figure out if both speakers are getting a "blend" of both sides or if you're only getting one of the mics, then post the results to get a more accurate answer.
Take a look at this question where the topic is discussed, maybe it has to do with the configuration in your source code.

How android call recorders apps works?

There are plenty apps in google play, which can record calls. Some of them just turn on loudspeaker and record sound via microphone, others should be able to record audio steams directly. I know that android provides class for recording. (which doesn't work on lot of devices probably because of some SW restrictions).
So here is my question: Is there possibility to find some device, where call recording will be possible via MediaRecorder(VOICE_CALL)? I found that call recording apps are available for Galaxy SII and SIII so does it means that MediaRecorder(VOICE_CALL) work on these devices?
EDIT------------
Generally, if i want to use MediaRecorder to record calls i need kernel which supports it (for example som custom kernel)?

Recording audio from many source/microphones

I'm curious if it's possible to record audio from many sources and if not, what's the limitation.
Many current devices have two internal microphones (basically for noise reduction). On top of that it's possible to plug additional external one using audiojack. You can as well have another audio stream via bluetooth headset.
You are allowed to specify AudioSource in android but is it possible to do recording from many sources at the same time? I'm also interested how the situation look like on the iOS devices.

Is it possible to access data / record from two (2) microphones in Android devices?

I am trying to access, programatically, the data received from 2 microphones on Android devices.
This arises several questions:
Are there shipping Android devices with 2 microphones (e.g. for stereo recording)? I know there are devices with 2 microphones for echo cancellation / noise reduction, but as far as I could find they can be accessed as a single microphone for any programatic purpose.
Are there devices with a microphone / headphone socket supporting stereo external microphones?
Assuming any of the above is positive, is there a way to know what is the currently operating microphone setup?
I will appreciate any response!
Thanks,
Yoav
I only found out that e.g. once you plug in wired headset with microphone it doesn't matter what AudioSource you specify in you code - it always give you the audio stream form headset mic. I tried to get access to internal mic using AudioSource.CAMCORDER but without luck. I haven't tried with wireless (BT) headset though. However if I plugin headphones (w/o mic) it uses internal microphone. At least this is the outcome on my SGS2 with ICS 4.0. If somebody find a workaround I would be happy to hear as well.
I haven't tried yet, but maybe the Native Developement Tools can allow you to access any microphone you want from low level.
If you want to make things a bit simpler, you could consider using OpenSL ES for Android, although i have no idea if it provides low-level microphone control.

Categories

Resources