I've searched everywhere, including the RootTools source. I can't find anything that manages the microphone, apart from muting it altogether. And there are no hints inside the AudioRecorder.setMicrophoneMute(bool) method either...
There are a few posts about this issue, but none of them ever go anywhere (through no fault of OPs'). Is it (legally) possible to override the OS and get to the mic hardware directly or something?
Thanks,
-tre
You can't directly set the recording volume, but you can change what you do with the byte data you get from AudioRecord (look at the AudioTrack class for reducing the volume of the track)
Edit: I forgot to mention that if you're having trouble with volume spikes you can look at automatic gain control. Some devices activate it automatically, but you can manually enable it.
On occasion, I get a phone or tablet with poorly chosen microphone input volume. Android 4 had it adjustable but not the newer versions. It makes it impossible to use VOIP. It's not just for fancy audio recordings.
Related
I got lots of help in this site. and I worked to patch Jelly bean Android for making it as a sink on Bluetooth.
How To Modify Android's Bluetooth Stack to Enable A2dp Sink
SNK works! but sound quality is bad!
There are lots of noises like sound distortion.
You can hear sound by click link : http://me2.do/5yLIflcx
password is 1111.
How could I make it good?
please, give me any hints.
I listened to the audio file.
The sound doesn't seem to drop or click, so that probably rules out Wi-Fi/BT coexistence problems and bandwidth problems.
An educated guess is that this has to do with the SBC implementation.
Also, if you place the mic and the audiosource in an isolated sound booth (improvise one) you should be able to find out it the mic is actually to sensitive and is picking up all that noise.
Also, when the codecs used for speech is used for music, it sounds somewhat like this, so you might want to look in to the codec implementation.
It would be easier if you had access to a bluetooth sniffer or virtual sniffing, that would let you see the negotiations and see what codecs etc. is under use.
Could you do virtual sniffing?
I have an audio recording app on android market which records using PCM-WAV format.
My app also offers custom gain control ([-20dB, +20dB]), so I alter the original audio data with user selected gain value.
It works pretty well when using device built-in mic, but I have a user which uses some external mic plugged into his device, and the output is too loud and full of distortions (because of the loudness of his ext mic). Even when he set the gain to -20dB, the output is loud and contains distortions.
I thought I should add AGC control into the app for cases as this.
Now my question:
This AGC only applies when using DEVICE BUILT-IN mic? Or it applies also when using an ext mic plugged into the handheld?
It's quite likely that the real problem is that his microphone is overdriving the input jack - if that is the case, software can't fix the problem as what the A/D converter sees is already hopelessly distorted.
Your client may need to add an attenuator (resistive voltage divider) to the input signal.
Also, if the input signal is asymmetric it may be necessary to couple through a series capacitor to block any DC component.
Doing a recording with no gain, and examining the resulting waveform in an audio editor like audacity would probably be informative.
(Normally I would not post something this speculative as an answer, but was specificaly asked to convert it to one from its original offering as a comment)
I wrote an app that records audio. Everything works. However, I am going to be using this app to record class room notes. How can I boost the input of the microphone to better capture all the noise? I wouldn't mind using root if I must. But wasn't sure if there was an API to do this.
Thanks all for reading!
If you are asking how to make the microphone more sensitive, I'm not sure. That would involve either operating the microphone at a higher voltage and/or hacking the drivers, neither of which are doable programatically, AFAIK. However, you could try amplifying the output by multiplying the output by some value (say 1.1 for 10% volume boost). Of course, the more you "amplify" the output, the more you will saturate the speaker (aka distort the audio). There are some signal processing techniques you can try to remove background noise and to isolate the paticular audio of interest, however, these things are merely processing improvements, not hardware upgrades. You can always try plugging in an external microphone into the headphone jack and using that to record the audio.
I know this isn't the answer you were hoping for, but I hope it helps.
I am developing an app to record voice.
I would like to increase the GAIN of the MIC.
Do I have to use AudioManager to do it or something during Audiorecord process?
Pointers to useful links regarding this question are at:
Can we Increase the gain of mic of an android phone?
I would try the setStreamVolume() approach initially though this is going to depend on the hardware and drivers of the device as well. Because there are so many different manufacturers and devices you may have trouble establishing a solid baseline value.
I've been asking around in developer circles about this, but so far no one has been able to confirm if it is possible. The default behavior for recording video in Android is to not use the external mic. I'd like to create an app that uses an external mic if it is available, but it seems like this might be tricky for some reason. Anyone have insight into this?
It seems like it would just be a matter of selecting it at this point in the recording setup:
recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
but it seems like there may be some oddness in doing that.
Thanks,
Jon
Default behavior in Android 12 (and I understand starting at 8 or 9) is that external microphones become the primary and default source for input.
It probably depends on the app, but at least video in the default camera app takes my external mic as default.
Take a look at the documentation here (look in the section titled "Performing Audio Capture") it covers setting up the audio capture.