Analogue automatic gain control
AGC is the way to go...


  Low frequency automatic gain control
  (AGC) circuits are used in audio and
  power equipment for applications such
  as sensitive microphone preamplifiers
  (preamps) and regulators. An AGC
  circuit, a closed-loop feedback
  system, is shown in Figure 1. The loop
  consists of a controllable gain
  element, a detector, a stable
  reference and a comparison circuit.
  
  
  
  Source: AN-934 60 dB Wide Dynamic Range, Low Frequency AGC Circuit Using a Single VGA


Fast and simple: Microphone AGC amplifier

Datasheets can be a good source of information on a topic (even if you don't use the product specified). From Maxim... 


  The MAX9814 is a low-cost,
  high-quality microphone amplifier with
  automatic gain control (AGC) and
  lownoise microphone bias.


AGC can also be implemented in software: dsPIC DSC Automatic Gain Control Library