Android selecting top microphone - android

How to select top microphone as audio source for recording audio in android.
Now I am using MediaRecorder.AudioSource.CAMCORDER as audio source but its not taking top mic for recording.

The developer documentation lists the supported audio sources. I am unsure what you mean with "top microphone" however I think you should use MediaRecorder.AudioSource.MIC.

In my case I used audioSource = MediaRecorder.AudioSource.MIC and channelConfig=AudioFormat.CHANNEL_IN_STEREO. Then choosing the RIGHT channel input which receive sound from TOP MIC on HUAWEI Mate10/Mate9.
Anyway this method is relate to the hardware, your code only works on specific model

Related

Android audio record external jack

I would like to record the sound of the jack entry of my android phone. I've been searching about the Audio Capture class in Android, and i've found this:
https://developer.android.com/guide/topics/media/audio-capture.html
In the settings of this class, there are many options to choose the rec default mic, as this:
Set the audio source using MediaRecorder.setAudioSource(). You will probably want to use MediaRecorder.AudioSource.MIC.
What should I use to get the sound of the jack entry? Is there any example?
Thank you!
The API you provided is the correct one.
Calling mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC) (assuming the correct initialization of MediaRecorder as described here https://developer.android.com/guide/topics/media/camera.html -> Capturing Videos) will behave like this:
When you launch your app and start recording without any Jacks connected, phone's default microphones will be used. As soon as Jack microphone pin has detected a microphone connected, the system will use the Jack mic pin as an audio imput. Hovewer, you need to know that even though the audio record will have two channels, they will be identical, as Jack microphone can only record mono stream.

Android using top microphone for recording [duplicate]

How to select top microphone as audio source for recording audio in android.
Now I am using MediaRecorder.AudioSource.CAMCORDER as audio source but its not taking top mic for recording.
The developer documentation lists the supported audio sources. I am unsure what you mean with "top microphone" however I think you should use MediaRecorder.AudioSource.MIC.
In my case I used audioSource = MediaRecorder.AudioSource.MIC and channelConfig=AudioFormat.CHANNEL_IN_STEREO. Then choosing the RIGHT channel input which receive sound from TOP MIC on HUAWEI Mate10/Mate9.
Anyway this method is relate to the hardware, your code only works on specific model

Is there any way to select specific speaker for android device?

We are developing a VOIP application, there is one component which need to record the audio from mic, and play the remote audio to speaker. And we need to do some audio/signal processing for the recorded audio.
But on some android device, the selected mic and speaker is so near, the audio captured from MIC clipping (too loud) because of the audio played by speaker. This cause the captured audio waveform have nonlinear losses, and make the audio/signal processing component doesn't work.
We doesn't want to set AUDIO_STREAM_VOICE_CALL to enable build-in AEC, because it will make the recorded audio sample rate to be 8k while I'd like the recorded audio to be 48k.
So We have consider following solution:
Decrease the mic volume. Base on this SO question and this discussion thread, it seams impossible.
Using specific speaker and mic to make the distance a little bit far, so the mic captured audio volume is low.
So any way to select specific speaker on android platform?
If the distance between microphone and the speaker is crucial here maybe is would be enough to use camera's mic:
MediaRecorder.AudioSource.CAMCORDER

how to capture data going for soundcard

I want to capture soundcard data.Means whatever playing on phone.It may be alert sounds,sound from sound etc,whatever sound is coming from device.I want to capture sound with android framework classes only.I dont want any native programming.Is it possible?If other tools are available plz provide me details.
If the device is in speakerphone mode, you can record via the microphone and it will pick up whatever the device is playing, along with any other ambient sounds. Use AudioRecord or MediaRecorder as you see fit.
If the device is not in speakerphone mode, you have no means of intercepting the audio output of other applications.

Getting microphone volume while recording

I'm using the simple app shown in the Android documentation to play around with recording and playing audio. Just to add a small feature, I want to get the volume of the microphone while it's recording to move a bar like how the voice recognition will fill the microphone while you are speaking into it. I looked around online, but no one seems to have a definitive answer, could someone point me in the right direction? Thanks!
i think there is no specific volume for mic. when you are recording that takes media volume as mic volume.

Categories

Resources