问题
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?
回答1:
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)
来源:https://stackoverflow.com/questions/23435951/automatic-gain-controlagc-for-external-mic