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.
Related
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.
We want to tackle the age old question of connecting two musicboxes over bluetooth and stream music on them simultaneously.
We know, that modern smartphones are able to connect to two devices but the output audio stream only connects to one device. And according to a lot of different sources the A2DP Profile is also only able to have one Master and one Slave.
Our approach would be a multiplexing of the said audio output between the two connected devices. So on android we would just have to change the desired audio output fast enough between two boxes.
The first question here would be if the switching between two audio outputs on android is fast enough and the music doesnt stop streaming?
Secondly we have to determine if the switching can happen fast enough for us to dont hear any skips.
Is it possible to play 2 different sounds simultaneously from 2 built-in speakers (1=main speaker, 2=earpiece speaker) on Android, preferably using Oboe C++ library.
In this thread, it was asked a similar question, but for 2 different audio devices. In my case, I just want to play on the same audio device but through 2 different speakers.
It was possible to record data from built-in microphones simultaneously using stereo channels. A similar approach for speakers didn't work.
Any help much appreciated, thank you.
Note:
The term Audio Device refers to a device capable of receiving or
sending audio. An audio device can have multiple microphones and/or
speakers attached to it, and these are represented as different
channels.
Debugging device is Google Pixel XL running Android 9
If the audio device has 2 speakers then you should be able to play different sounds through each speaker by supplying different data to each channel.
However, I believe the speakers you're referring to:
2 built-in speakers (1=main speaker, 2=earpiece speaker)
are actually 2 separate audio devices each with a single speaker. In which case you won't be able to use them at the same time, although hacks might be available to make the speakers part of the same audio device (I haven't tried this).
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.
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.